Submission #691757

#TimeUsernameProblemLanguageResultExecution timeMemory
691757AiperiiiTrampoline (info1cup20_trampoline)C++14
62 / 100
2027 ms11788 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int r,c,n; cin>>r>>c>>n; map <int,vector <long long > > mp; while(n--){ int x,y; cin>>x>>y; mp[x].push_back(y); } for(auto x : mp){ vector <long long > vec=x.second; sort(vec.begin(),vec.end()); mp[x.first]=vec; } int t; cin>>t; while(t--){ int x1,x2,y1,y2; cin>>x1>>y1>>x2>>y2; string ans="Yes"; if(x1>x2 or y1>y2){ ans="No"; } int y=y1; for(int i=x1;i<x2;i++){ vector < long long > vec=mp[i]; if(vec.size()==0){ ans="No"; break; } vec.insert(vec.begin(),-2e9); vec.push_back(2e9); long long l=0; long long r=vec.size(); while(r-l>1){ long long mid=(l+r)/2; if(vec[mid]<y){ l=mid; } else{ r=mid; } } if(r==vec.size()-1 ){ ans="No"; break; } else { y=vec[r]; } } if(y>y2){ ans="No"; } cout<<ans<<endl; } }

Compilation message (stderr)

trampoline.cpp: In function 'int main()':
trampoline.cpp:46:17: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |             if(r==vec.size()-1 ){
      |                ~^~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...