Task: | Dynamic Range Minimum Queries |
Sender: | htoik |
Submission time: | 2024-09-25 15:09:04 +0300 |
Language: | C++ (C++20) |
Status: | READY |
Result: | TIME LIMIT EXCEEDED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.00 s | details |
#2 | TIME LIMIT EXCEEDED | -- | details |
Code
#include <bits/stdc++.h> using namespace std; typedef unsigned long long ull; int main(){ ull n, q; std::cin >> n >> q; vector<ull> ns; ns.reserve(n); for(ull i=0; i<n; i++){ ull nn; cin >> nn; ns.push_back(nn); } for(ull i=0; i<q; i++){ ull t, a, b; cin >> t >> a >> b; if(t == 1){ ns[a-1] = b; } else{ ull minval = *min_element(ns.begin()+(a-1), ns.begin()+(b)); cout << minval << endl; } } }