# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
973030 | 2024-05-01T12:38:26 Z | vjudge1 | Deda (COCI17_deda) | C++17 | 22 ms | 1116 KB |
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n,q; int a[n+5]; cin>>n>>q; for(int i=0;i<=n;i++){ a[i]=0; } vector<int> v; string s; int x,b; while(q--){ cin>>s>>x>>b; if(s=="M"){ a[b]=x; v.push_back(b); } else{ sort(v.begin(),v.end()); int flag=1; for(int i=0;i<v.size();i++){ if(v[i]>=b){ if(a[v[i]]<=x){ cout<<v[i]<<'\n'; flag=0; break; } } } if(flag){ cout<<"-1\n"; } } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 604 KB | Output is correct |
2 | Correct | 1 ms | 600 KB | Output is correct |
3 | Correct | 22 ms | 604 KB | Output is correct |
4 | Runtime error | 1 ms | 1112 KB | Execution killed with signal 11 |
5 | Runtime error | 1 ms | 1000 KB | Execution killed with signal 11 |
6 | Runtime error | 1 ms | 1116 KB | Execution killed with signal 11 |
7 | Runtime error | 1 ms | 1012 KB | Execution killed with signal 11 |