#include <bits/stdc++.h>
using namespace std;
void solve() {
int r, c;
cin >> r >> c;
int n;
cin >> n;
map <int, int> mp;
set <int> xs;
for(int i = 0; i < n; i ++) {
int a, b;
cin >> a >> b;
a --;
b --;
xs.insert(a);
mp[a] = b;
}
int T;
cin >> T;
while(T --) {
pair <int, int> start, end;
cin >> start.first >> start.second >> end.first >> end.second;
start.first --;
start.second --;
end.first --;
end.second --;
/*if(start.first == end.first) {
cout << "Yes\n";
continue;
}
int temp = start.second;
for(int i = start.first; i < end.first; i ++) {
if(xs.count(i) == 0) {
// cout << i << " ";
cout << "No\n";
goto end;
}
}
for(int i = start.first; i < end.first; i ++) {
int where = mp[i];
if(where < temp or where > end.second) {
cout << "No\n";
// cout << i << " ";
goto end;
}
temp = where;
}
cout << "Yes\n";
end:;*/
if(xs.count(start.first) and mp[start.first] <= end.second and mp[start.first] >= start.second)
cout << "Yes\n";
else cout << "No\n";
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int Q = 1;
//cin >> Q;
while (Q --) {
solve();
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
328 KB |
expected YES, found NO [5th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
50 ms |
544 KB |
expected NO, found YES [2nd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
113 ms |
836 KB |
expected YES, found NO [4th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
312 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
338 ms |
8476 KB |
expected YES, found NO [3rd token] |
2 |
Halted |
0 ms |
0 KB |
- |