Submission #522140

#TimeUsernameProblemLanguageResultExecution timeMemory
522140maks007Trampoline (info1cup20_trampoline)C++14
0 / 100
380 ms1048580 KiB
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; cin >> n >> m; vector <int> a[n]; int q; cin >> q; while(q --) { int x, y; cin >> x >> y; x --; y --; a[x].push_back(y); } for(int i = 0; i < n; i ++) sort(a[i].begin(), a[i].end()); cin >> q; while(q --) { int startx, starty, endx, endy; cin >> startx >> starty >> endx >> endy; startx --; starty --; endx --; endy --; while(startx != endx) { auto it = lower_bound(a[startx].begin(), a[startx].end(), starty); if(it == a[startx].end()) { goto end; } startx ++; starty = *it; } cout << "Yes\n"; continue; end:; cout << "No\n"; } return false; }
#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...