# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
234396 | VEGAnn | Deda (COCI17_deda) | C++14 | 1075 ms | 5600 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
using namespace std;
typedef long long ll;
const int N = 200100;
const int oo = 2e9;
int n, q, tim[N];
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef _LOCAL
freopen("in.txt","r",stdin);
#endif // _LOCAL
cin >> n >> q;
for (int i = 0; i < n; i++)
tim[i] = oo;
for (; q; q--){
char tp; int a, b; cin >> tp >> a >> b;
b--;
if (tp == 'M')
tim[b] = a;
else {
int ans = -1;
for (int i = b; i < n; i++)
if (tim[i] <= a){
ans = i + 1;
break;
}
cout << ans << '\n';
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |