# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
472831 | Ahmed_Solyman | Deda (COCI17_deda) | C++14 | 1094 ms | 25020 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>
using namespace std;
typedef long long ll;
int main()
{
ll n,q;cin>>n>>q;
map<ll,bool>vis;
map<ll,ll>mp;
while(q--){
char c;cin>>c;
if(c=='M'){
ll x,a;cin>>x>>a;
mp[a]=x;
vis[a]=1;
}
else{
ll y,b;cin>>y>>b;
ll ans=-1;
for(ll i=b;i<=n;i++){
if(mp[i]<=y && vis[i]){
ans=i;
break;
}
}
cout<<ans<<endl;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |