Submission #692298

# Submission time Handle Problem Language Result Execution time Memory
692298 2023-02-01T10:21:23 Z NeroZein Trampoline (info1cup20_trampoline) C++14
23 / 100
343 ms 11724 KB
/*
 *    author: NeroZein
 *    created: 01.02.2023 13:03:54
*/
#include <bits/stdc++.h>
using namespace std;

#ifdef Nero
#include "Deb.h"
#else
#define deb(...)
#endif

const int N = 2503; 
set<int> se[N];

signed main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int r, c, n;
	cin >> r >> c >> n;
	for (int i = 0; i < n; ++i) {
		int x, y;
		cin >> x >> y;
		se[x].insert(y); 
	}
	int q;
	cin >> q; 
	while(q--) {
		int xs, ys, xf, yf;
		cin >> xs >> ys >> xf >> yf; 
		while(yf > ys && xf > xs) {
			if (se[xf-1].empty()) {
				break; 
			}
			auto it = se[xf-1].upper_bound(yf);
			if (it == se[xf-1].begin()) { 
				break; 
			}
			--it; 
			yf = *it; 
			--xf; 
		}
		cout << (xf == xs && yf >= ys ? "YES" : "NO") << '\n';
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 852 KB 200 token(s): yes count is 21, no count is 179
2 Correct 4 ms 980 KB 200 token(s): yes count is 70, no count is 130
3 Correct 3 ms 724 KB 197 token(s): yes count is 25, no count is 172
# Verdict Execution time Memory Grader output
1 Correct 114 ms 11596 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 110 ms 11588 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 343 ms 11364 KB 4000 token(s): yes count is 4000, no count is 0
4 Incorrect 288 ms 11724 KB expected YES, found NO [993rd token]
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 724 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 724 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 724 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -