#include <bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
#define ff first
#define ss second
#define ll long long
using namespace std;
const int MAX=2505;
const ll INF=1e10;
map<int,vector<ll>>m;
ll imp(ll a,ll dif,ll c){
while(dif--){
auto it=lower_bound(m[a].begin(),m[a].end(),c);
if(it==m[a].end()){
c=INF;
return c;
}
c=*it;
a++;
}
return c;
}
void go(){
int n, r,c; cin>>r>>c>>n;
for(int i=0;i<n;i++){
int a,b; cin>>a>>b;
m[a].push_back(b);
}
for(auto it:m){
sort(it.ss.begin(),it.ss.end());
}
int t; cin>>t;
while(t--){
ll a,b,e,d; cin>>a>>b>>e>>d;
if(a>e or b>d) cout<<"No"<<endl;
ll dif=e-a;
ll nc=imp(a,dif,b);
if(nc<=d) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
}
int main(){
fastio;
go();
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
468 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
51 ms |
5264 KB |
expected YES, found NO [3rd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
351 ms |
15256 KB |
expected YES, found NO [4th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
10 ms |
596 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
707 ms |
22448 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |