Submission #530227

# Submission time Handle Problem Language Result Execution time Memory
530227 2022-02-24T20:17:59 Z Jean7 Trampoline (info1cup20_trampoline) C++14
0 / 100
48 ms 9464 KB
#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 ;
}
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 468 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 452 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 460 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -