# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
973036 | 2024-05-01T12:43:42 Z | vjudge1 | Deda (COCI17_deda) | C++17 | 1000 ms | 52628 KB |
#include <bits/stdc++.h> using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); long long n,q; long long a[n+5]; cin>>n>>q; for(int i=0;i<=n;i++){ a[i]=0; } vector<long long> v; string s; long long 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 22 ms | 48220 KB | Output is correct |
2 | Correct | 23 ms | 48220 KB | Output is correct |
3 | Correct | 44 ms | 48208 KB | Output is correct |
4 | Correct | 334 ms | 52628 KB | Output is correct |
5 | Execution timed out | 1059 ms | 48996 KB | Time limit exceeded |
6 | Execution timed out | 1068 ms | 49124 KB | Time limit exceeded |
7 | Execution timed out | 1049 ms | 49156 KB | Time limit exceeded |