#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll r , c , n , x , y , a, b, t;
cin >> r>> c >> n ;
int next[r+1][c+1] , grid[r+1][c+1]={0};
for(int i = 0 ; i < n ; i++)
{
cin >> x>> y ;
grid[x][y]=1;
}
for(int i = 1 ; i <= r ; i++)
{
x=c+1;
for(int j = c; j>=1 ; j--)
{
if(grid[i][j])x=j;
next[i][j]=x;
}
}
// for(int i = 1 ; i <= r ; i++)
// {
// x=c+1;
// for(int j = 1; j<=c ; j++)
// {
// cout << next[i][j]<< " ";
// }
// cout << "\n";
// }
cin >> t;
while(t--)
{
cin>> x >> y >> a >> b ;
int j=y;
int impos=0;
for(int i = x ; i<a ; i++)
{
j=next[i][j];
if(j>b)
{
impos=1;
break;
}
}
if(impos)
{
cout << "No\n";
}
else cout << "Yes\n";
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
5 ms |
620 KB |
expected NO, found YES [13th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
189 ms |
49300 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
176 ms |
49260 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
110 ms |
2156 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Incorrect |
235 ms |
49260 KB |
expected NO, found YES [1000th token] |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
492 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |