Submission #480969

# Submission time Handle Problem Language Result Execution time Memory
480969 2021-10-19T03:15:17 Z rk42745417 Trampoline (info1cup20_trampoline) C++17
73 / 100
2000 ms 2620 KB
#include <bits/stdc++.h>
using namespace std;

#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(0);
using ll = int64_t;
using uint = uint32_t;
using ull = uint64_t;
using ld = long double;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-8;
const ll LINF = ll(1e18) + ll(1e15);
static auto LamyIsCute = []() {
	EmiliaMyWife
	return 48763;
}();

signed main() {
	int r, c, n;
	cin >> r >> c >> n;
	vector<pair<int, int>> arr(n);
	for(int i = 0; i < n; i++)
		cin >> arr[i].first >> arr[i].second;
	sort(arr.begin(), arr.end());
	int q;
	cin >> q;
	auto query = [&]() {
		int x1, y1, x2, y2;
		cin >> x1 >> y1 >> x2 >> y2;
		if(x1 > x2 || y1 > y2)
			return false;
		while(x1 < x2) {
			auto l = lower_bound(arr.begin(), arr.end(), make_pair(x1, y1));
			if(l == arr.end() || l->first != x1 || l->second > y2)
				return false;
			x1++;
			y1 = l->second;
		}
		return true;
	};
	while(q--) {
		cout << (query() ? "Yes" : "No") << '\n';
	}
}
# Verdict Execution time Memory Grader output
1 Correct 3 ms 372 KB 200 token(s): yes count is 21, no count is 179
2 Correct 3 ms 460 KB 200 token(s): yes count is 70, no count is 130
3 Correct 3 ms 332 KB 197 token(s): yes count is 25, no count is 172
# Verdict Execution time Memory Grader output
1 Correct 70 ms 1872 KB 4000 token(s): yes count is 99, no count is 3901
2 Correct 73 ms 1880 KB 4000 token(s): yes count is 91, no count is 3909
3 Correct 226 ms 1868 KB 4000 token(s): yes count is 4000, no count is 0
4 Correct 247 ms 1880 KB 4000 token(s): yes count is 1991, no count is 2009
# Verdict Execution time Memory Grader output
1 Correct 192 ms 2524 KB 200000 token(s): yes count is 110486, no count is 89514
2 Correct 202 ms 2504 KB 200000 token(s): yes count is 114664, no count is 85336
3 Correct 204 ms 2500 KB 200000 token(s): yes count is 86232, no count is 113768
4 Correct 195 ms 2620 KB 200000 token(s): yes count is 94603, no count is 105397
5 Correct 228 ms 2540 KB 200000 token(s): yes count is 94148, no count is 105852
6 Correct 185 ms 2520 KB 200000 token(s): yes count is 97163, no count is 102837
# Verdict Execution time Memory Grader output
1 Correct 6 ms 332 KB 5000 token(s): yes count is 3238, no count is 1762
2 Correct 10 ms 588 KB 5000 token(s): yes count is 3837, no count is 1163
3 Correct 5 ms 588 KB 5000 token(s): yes count is 4104, no count is 896
4 Correct 6 ms 588 KB 5000 token(s): yes count is 3934, no count is 1066
5 Correct 149 ms 620 KB 5000 token(s): yes count is 3384, no count is 1616
6 Correct 6 ms 588 KB 5000 token(s): yes count is 3390, no count is 1610
# Verdict Execution time Memory Grader output
1 Execution timed out 2091 ms 1868 KB Time limit exceeded
2 Halted 0 ms 0 KB -