Submission #503999

# Submission time Handle Problem Language Result Execution time Memory
503999 2022-01-09T12:41:27 Z bebecanvas Trampoline (info1cup20_trampoline) C++14
43 / 100
498 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;
		if(a>c){yea= false;}
		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 Correct 2 ms 588 KB 200 token(s): yes count is 21, no count is 179
2 Correct 2 ms 584 KB 200 token(s): yes count is 70, no count is 130
3 Correct 2 ms 588 KB 197 token(s): yes count is 25, no count is 172
# Verdict Execution time Memory Grader output
1 Correct 88 ms 49232 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 89 ms 49228 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 31 ms 2172 KB 4000 token(s): yes count is 4000, no count is 0
4 Correct 117 ms 49232 KB 4000 token(s): yes count is 1991, no count is 2009
# Verdict Execution time Memory Grader output
1 Runtime error 498 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 387 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 391 ms 1048580 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -