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 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;
set<int> s[r];
for(int i=0; i<n; i++){
int a, b; cin >> a >> b; a--; b--;
s[a].insert(b);
}
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--;
set<int> ::iterator it;
it= s[a].lower_bound(b);
if(it!=s[a].end()){
int f= *it;
if(f<=d){cout << "Yes" << endl;}
else{cout << "No" << endl;}
}else{cout << "No" << endl;}
}
}
# | 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... |