#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
588 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
108 ms |
3536 KB |
expected NO, found YES [121st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
368 ms |
1048580 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
360 ms |
1048580 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
380 ms |
1048580 KB |
Execution killed with signal 9 |
2 |
Halted |
0 ms |
0 KB |
- |