#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll>v[200001];
int main()
{
ll r , c , n , x , y , a, b, t;
cin >> r>> c >> n ;
//cout << r << " " << c << " " << n << "\n";
map<ll,ll>mp;
//cout << "haha\n";
ll cnt=1;
for(int i = 0 ; i < n ; i++)
{
cin >> x>> y ;
if(!mp[x])mp[x]=cnt++;
v[mp[x]].push_back(y);
}
cin >> t;
while(t--)
{
cin>> x >> y >> a >> b ;
if(x==a)
{
if(y<=b)
{
cout << "Yes\n";
}
else cout << "No\n";
continue;
}
int j=y;
int impos=1;
for(int i = x ; i<a ; i++)
{
if(mp[i]==0)
{
impos=0;
break;
}
vector<ll>::iterator it = lower_bound(v[mp[i]].begin() , v[mp[i]].end() , j);
if(it==v[mp[i]].end())
{
j=c+1;
}
else j=*it;
if(j>b)
{
impos=1;
break;
}
if(i==a-1)
{
impos=0;
}
}
if(impos)
{
cout << "No\n";
}
else cout << "Yes\n";
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
5100 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
164 ms |
8184 KB |
expected YES, found NO [3rd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1008 ms |
7964 KB |
expected YES, found NO [4th token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
28 ms |
5100 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1941 ms |
21480 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |