#include <bits/stdc++.h>
using namespace std;
int main(){
int r,c,n;
cin>>r>>c>>n;
map < pair <int,int> ,int> mp;
while(n--){
int x,y;
cin>>x>>y;
pair <int,int> p=make_pair(x,y);
mp[p]=1;
}
int t;
cin>>t;
while(t--){
int x1,y1,x2,y2;
cin>>x1>>y1>>x2>>y2;
string ans="";
if(x1>x2 or y1>y2){
ans="No";
}
int y=y1;
int cnt=0;
for(int i=x1;i<x2;i++){
bool c=false;
for(auto x : mp){
pair <int,int> p=x.first;
if(p.first==i && p.second>=y){
cnt++;
y=p.second;
c=true;
break;
}
}
if(c==false){
ans="No";
break;
}
}
if(ans!="No" && cnt==x2-x1 && y<=y2){
ans="Yes";
}
cout<<ans<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
279 ms |
824 KB |
expected NO, found YES [4th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2075 ms |
14600 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2074 ms |
16824 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
537 ms |
900 KB |
expected NO, found YES [60th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2061 ms |
16836 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |