#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 time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
428 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
116 ms |
1840 KB |
expected YES, found NO [3rd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
596 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
596 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
2 ms |
468 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |