#include <bits/stdc++.h>
#define int long long
/**
|||||||||| ||||| ||||| ||||||||||
||||||||||||| ||||| ||||| |||||
|||| |||||| ||||| ||||| |||||
||||||||||||||||| ||||||||||||||| ||||||||||
||||||||||||||||||| ||||||||||||||| |||||
||||| ||||| ||||| ||||| |||||
||||| ||||| ||||| ||||| ||||||||||
AHMED;HASSAN;SAEED;
*/
using namespace std;
int32_t main()
{
/**ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);*/
int r,c,n;
cin>>r>>c>>n;
vector<vector<int> >grs(r+5);
for(int i=0;i<n;i++){
int x,y;
cin>>x>>y;
grs[x].push_back(y);
}
for(int i=1;i<=r;i++)
sort(grs[i].begin(),grs[i].end());
int t;
cin>>t;
while(t--){
int xs,ys,xe,ye;
cin>>xs>>ys>>xe>>ye;
int f=1;
if(xs>xe||ys>ye){
f=0;
}
while(xs!=xe){
if(xs>xe||ys>ye){
f=0;
break;
}
vector<int>::iterator it=lower_bound(grs[xs].begin(),grs[xs].end(),ys);
if(it==grs[xs].end()){
f=0;
break;
}
ys=*it;
xs++;
if(xs>xe||ys>ye){
f=0;
break;
}
}
if(f)
cout<<"Yes\n";
else
cout<<"No\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
492 KB |
200 token(s): yes count is 21, no count is 179 |
2 |
Correct |
6 ms |
492 KB |
200 token(s): yes count is 70, no count is 130 |
3 |
Correct |
4 ms |
492 KB |
197 token(s): yes count is 25, no count is 172 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
128 ms |
3564 KB |
4000 token(s): yes count is 99, no count is 3901 |
2 |
Correct |
130 ms |
3308 KB |
4000 token(s): yes count is 91, no count is 3909 |
3 |
Correct |
167 ms |
2924 KB |
4000 token(s): yes count is 4000, no count is 0 |
4 |
Correct |
186 ms |
3308 KB |
4000 token(s): yes count is 1991, no count is 2009 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
620 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
4 ms |
700 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
3 ms |
620 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |