Submission #365967

#TimeUsernameProblemLanguageResultExecution timeMemory
365967sobaTrampoline (info1cup20_trampoline)C++14
0 / 100
1941 ms21480 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; vector<ll>v[200001]; int main() { ll r , c , n , x , y , a, b, t; cin >> r>> c >> n ; //cout << r << " " << c << " " << n << "\n"; map<ll,ll>mp; //cout << "haha\n"; ll cnt=1; for(int i = 0 ; i < n ; i++) { cin >> x>> y ; if(!mp[x])mp[x]=cnt++; v[mp[x]].push_back(y); } cin >> t; while(t--) { cin>> x >> y >> a >> b ; if(x==a) { if(y<=b) { cout << "Yes\n"; } else cout << "No\n"; continue; } int j=y; int impos=1; for(int i = x ; i<a ; i++) { if(mp[i]==0) { impos=0; break; } vector<ll>::iterator it = lower_bound(v[mp[i]].begin() , v[mp[i]].end() , j); if(it==v[mp[i]].end()) { j=c+1; } else j=*it; if(j>b) { impos=1; break; } if(i==a-1) { impos=0; } } if(impos) { cout << "No\n"; } else cout << "Yes\n"; } return 0; }
#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...