#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n, m;
cin >> n >> m;
map <int,vector <int>> a;
int q;
cin >> q;
while(q --) {
int x, y;
cin >> x >> y;
x --;
y --;
a[x].push_back(y);
}
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 time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
332 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
115 ms |
2884 KB |
expected YES, found NO [3rd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
697 ms |
13992 KB |
expected NO, found YES [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
19 ms |
580 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1166 ms |
21264 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |