This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main()
{
int r,c,n,t;
cin>>r>>c>>n;
vector<int>m(r+1,c+10);
for(int i{};i<n;++i){
int a,b;
cin>>a>>b;
if(m[a]==0){
m[a]=b;
}else{}
m[a]=min(m[a],b);
}
cin>>t;
for(int i{};i<t;++i){
int x1,x2,y1,y2;
cin>>x1>>y1>>x2>>y2;
if(x1==x2) cout<<"Yes"<<'\n';
else{
bool pass{true};
for(int j{x1};j<x2;++j){
if(!(m[j]>=y1&&m[j]<=y2)){
pass=false;
}else{
y1=m[j];
}
}
if(pass){
cout<<"Yes"<<'\n';
}else{
cout<<"No"<<'\n';
}
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |