#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define int long long
using namespace std ;
bool a[3000][3000] ;
signed main ()
{
fastio ;
int r , c , n , x , y , t , sx , sy , ex , ey ;
cin >> r >> c >> n ;
while ( n-- )
{
cin >> x >> y ;
a[x][y] = 1 ;
}
cin >> t ;
while ( t-- )
{
cin >> sx >> sy >> ex >> ey ;
if ( sx > ex || sy > ey ) { cout << "NO\n" ; continue ; }
while ( sx != ex && sy != ey && sx <= r && sy < c )
{
if ( a[sx][sy] ) sx++ ;
else sy++ ;
}
sx == ex ? cout << "YES\n" : cout << "NO\n" ;
}
return 0 ;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
832 KB |
200 token(s): yes count is 21, no count is 179 |
2 |
Incorrect |
2 ms |
844 KB |
expected YES, found NO [150th token] |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
43 ms |
9420 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
48 ms |
9464 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
30 ms |
3268 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Incorrect |
46 ms |
9424 KB |
expected YES, found NO [544th token] |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
468 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
452 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |