Submission #691609

#TimeUsernameProblemLanguageResultExecution timeMemory
691609AramisTrampoline (info1cup20_trampoline)C++17
0 / 100
116 ms1840 KiB
#include <bits/stdc++.h> using namespace std; int main() { int c, r, n; cin >> c >> r >> n; vector<vector<int> > x(c+1); for (int i=0; i<n; i++) { int a, b; cin >> a >> b; x[a].push_back(b); } int t; cin >> t; while (t--) { int xs, ys, xe, ye; cin >> xs >> ys >> xe >> ye; if (xe<xs || ye<ys) cout << "No\n"; else { for (int i=xs; (i<xe && ys<=ye); i++) { int l=0, ri=x[i].size()-1; while (l<ri) { int mid=(l+ri)/2; if (x[i][mid]<ys) l=mid+1; else ri=mid; } if (x[i].size()>0 && x[i][l]>=ys) ys=x[i][l]; else ys=ye+1; } if (ys>ye) 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...