Submission #503998

# Submission time Handle Problem Language Result Execution time Memory
503998 2022-01-09T12:41:11 Z bebecanvas Trampoline (info1cup20_trampoline) C++14
0 / 100
398 ms 1048580 KB
#include <bits/stdc++.h>

using namespace std;
#define int long long
#define endl '\n'


signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int r, c, n; cin >> r >> c >> n;
    int g[r][c];
    for(int i=0; i<r; i++){
		for(int j=0; j<c; j++){
			g[i][j]= -1;
		}
	}

	for(int i=0; i<n; i++){
		int a, b; cin >> a >> b; a--; b--;
		g[a][b]= b;
	}
	
	for(int i=0; i<r; i++){
		for(int j=0; j<c; j++){
			if(j==0){continue;}
			if(g[i][j-1]>g[i][j]){g[i][j]= g[i][j-1];}
		}
	}
	
	int q; cin >> q;
	for(int i=0; i<q; i++){
		int a, b, c, d; cin >> a >> b >> c >> d;
		a--; b--; c--; d--;
		
		bool yea= true;
		while(c>a){
			if(g[c-1][d]==-1){yea= false; break;}
			d= g[c-1][d];
			c--;
			if(d<b){yea= false; break;}
		}
		
		if(yea){cout << "Yes" << endl;}
		else{cout << "No" << endl;}
	}
	

    
	
	

}

# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 588 KB expected NO, found YES [13th token]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 89 ms 50828 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 90 ms 50992 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 33 ms 3660 KB 4000 token(s): yes count is 4000, no count is 0
4 Incorrect 117 ms 51012 KB expected NO, found YES [1000th token]
# Verdict Execution time Memory Grader output
1 Runtime error 368 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 398 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 392 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -