This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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;
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |