#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;
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";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
332 KB |
expected NO, found YES [27th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
58 ms |
1788 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
55 ms |
1972 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
86 ms |
1780 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Incorrect |
96 ms |
2040 KB |
expected NO, found YES [1000th token] |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |