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 <iostream>
#include <map>
#include <set>
//#include <fstream>
using namespace std;
//ifstream F("be.txt");
//ofstream Fo("ki.txt");
map<int, set<int> > m;
int N, R, C, T;
int main(){
cin >> R >> C >> N;
int x, y;
for(int i = 1; i <= N; ++i){
cin >> x >> y;
m[x].insert(y);
}
cin >> T;
int x1, y1;
while(T--){
bool flag = false;
cin >> x >> y >> x1 >> y1;
if(x > x1 || y > y1)
flag = false;
else if(x == x1)
flag = true;
else {
int i = x, t = y;
while(m.count(i) && i != x1){
auto it = m[i].lower_bound(t);
if(it == m[i].end()) break;
t = *it;
if(t > y1) break;
++i;
}
if(i == x1)
flag = true;
else
flag = false;
}
cout << (flag ? "Yes\n" : "No\n");
}
return 0;
}
# | 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... |