Submission #472853

#TimeUsernameProblemLanguageResultExecution timeMemory
472853Ahmed57Deda (COCI17_deda)C++14
80 / 140
1092 ms4768 KiB
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n,m; cin>>n>>m; vector<pair<long long,long long>> v; for(int i = 0;i<m;i++){ char x;long long a,b; cin>>x>>a>>b; if(x=='M'){ v.push_back({a,b}); }else{ long long ans = 1e18; for(int j = 0;j<v.size();j++){ if(v[j].second>=b&&v[j].first<=a){ ans = min(ans,v[j].second); } } if(ans==1e18){ cout<<-1<<"\n"; }else cout<<ans<<"\n"; } } return 0; }

Compilation message (stderr)

deda.cpp: In function 'int main()':
deda.cpp:17:28: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |             for(int j = 0;j<v.size();j++){
      |                           ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...