#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
#define mp make_pair
#define f first
#define s second
vector<int> oo[2505];
int32_t main(){
ios_base::sync_with_stdio(false);cin.tie(0);
int r,c,n;
cin>>r>>c>>n;
int a,b,d;
for(int i=0;i<n;i++){
cin>>a>>b;
oo[a].push_back(b);
}
for(int i=0;i<=r;i++){
if(oo[i].size()>0)sort(oo[i].begin(),oo[i].end());
}
int q;
cin>>q;
while(q--){
cin>>a>>b>>c>>d;
int cur=b;
if(a>c)goto hell;
for(int j=a;j<c;j++){
if(oo[j].size()==0 || oo[j].back()<cur)goto hell;
cur=*lower_bound(oo[j].begin(),oo[j].end(),cur);
if(cur>d)goto hell;
}
if(cur>d)goto hell;
cout<<"Yes\n";continue;
hell:;
cout<<"No\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
332 KB |
200 token(s): yes count is 21, no count is 179 |
2 |
Correct |
4 ms |
460 KB |
200 token(s): yes count is 70, no count is 130 |
3 |
Correct |
2 ms |
332 KB |
197 token(s): yes count is 25, no count is 172 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
58 ms |
1780 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
55 ms |
1760 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
108 ms |
1504 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Correct |
99 ms |
1772 KB |
4000 token(s): yes count is 1991, no count is 2009 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |