#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <limits>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unordered_multiset<ll> whydoweneedunorderedmultiset;
#define ff first
#define ss second
#define esle else
ll ttt;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const ll N = 9;
ll l, r, k, n, m;
vector<int> g[100007];
int main() {
cin >> k >> m >> n;
for (int i = 0; i < n; i++) {
ll x, y;
cin >> x >> y;
g[x].push_back(y);
}
cin >> ttt;
while (ttt--) {
ll xs, ys, xe, ye;
cin >> xs >> ys >> xe >> ye;
if (xs == xe) {
cout << "YES" << endl;
}
else if (xs > xe || ys > ye) {
cout << "NO" << endl;
}
else {
ll cur_y = ys;
ll cur_x = xs;
bool ok = true;
while (cur_x != xe && cur_y <= ye) {
auto it = lower_bound(g[cur_x].begin(), g[cur_x].end(), cur_y);
if (it == g[cur_x].end()) {
ok = false;
break;
}
else {
cur_y = *it;
}
cur_x++;
}
ok = ok && (cur_y <= ye);
if (ok) {
cout << "YES" << endl;
}
else cout << "NO" << endl;
}
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
2764 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
93 ms |
5848 KB |
expected YES, found NO [3rd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
4 ms |
5196 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
5080 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
5196 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |