Submission #921011

#TimeUsernameProblemLanguageResultExecution timeMemory
921011Sandarach151Trampoline (info1cup20_trampoline)C++17
0 / 100
2037 ms9912 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int r, c, t; cin >> r >> c >> t; map<int, vector<int> > mp; for(int i=0; i<t; i++){ int a, b; cin >> a >> b; if(!mp.count(a)){ vector<int> temp; mp[a] = temp; } mp[a].push_back(b); } for(auto u : mp){ sort(u.second.begin(), u.second.end()); } // for(auto u : mp){ // if(mp.count(u.first+1)==0){ // continue; // } // auto temp = mp[u.first+1]; // for(auto x : u.second){ // x.second = lower_bound(temp.begin(), temp.end(), x.first)->first; // } // } int q; cin >> q; while(q--){ int a, b, c, d; cin >> a >> b >> c >> d; while(a<c && b<=d){ vector<int> temp = mp[a]; auto it = lower_bound(temp.begin(), temp.end(), b); if(it==temp.end()){ break; } else{ b = *it; a++; } // cout << a << ", " << b << "\n"; } if(b<=d && a==c) cout << "Yes\n"; else cout << "No\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...