Submission #503997

# Submission time Handle Problem Language Result Execution time Memory
503997 2022-01-09T12:40:07 Z bebecanvas Trampoline (info1cup20_trampoline) C++14
0 / 100
413 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 94 ms 51064 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 89 ms 50996 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 41 ms 3652 KB 4000 token(s): yes count is 4000, no count is 0
4 Incorrect 126 ms 51064 KB expected NO, found YES [1000th token]
# Verdict Execution time Memory Grader output
1 Runtime error 372 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 359 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 413 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -