#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";
}
else{
ans="No";
}
cout<<ans<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
283 ms |
744 KB |
200 token(s): yes count is 21, no count is 179 |
2 |
Correct |
520 ms |
988 KB |
200 token(s): yes count is 70, no count is 130 |
3 |
Correct |
178 ms |
712 KB |
197 token(s): yes count is 25, no count is 172 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2089 ms |
12796 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2099 ms |
12696 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
565 ms |
604 KB |
5000 token(s): yes count is 3238, no count is 1762 |
2 |
Execution timed out |
2061 ms |
1028 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2092 ms |
12760 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |