#include <bits/stdc++.h>
using namespace std;
#define int long long
int n, k, t;
int a, b;
vector<bool> green[2500];
int startx, starty, endx, endy;
string move(int sx, int sy, int ex, int ey) {
if (sx == ex and sy == ey) {
return "Yes";
}
else if (green[sx][sy]) {
if (sx == ex) {
return move(sx+1, sy, ex, ey);
}
return move(sx, sy+1, ex, ey);
}
else if (sy == ey) {
return "No";
}
else {
return move(sx, sy+1, ex, ey);
}
}
signed main() {
ios_base::sync_with_stdio(false); cin.tie(NULL);
cin >> n >> k;
for (int i=0; i<n; i++) {
cin >> a >> b;
a--; b--;
green[a][b] = true;
}
for (int i=0; i<t; i++) {
cin >> startx >> starty >> endx >> endy;
startx--; starty--; endx--; endy--;
cout << move(startx, starty, endx, endy);
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
588 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
556 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
588 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
588 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
588 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |