#include <bits/stdc++.h>
using namespace std;
#define st first
#define nd second
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll n,m,g,q;
cin>>n>>m>>g;
vector<vector<int>>a(n);
for(ll i=0;i<g;i++)
{
ll x,y;
cin>>x>>y;
a[x-1].push_back(y-1);
}
cin>>q;
while(q--)
{
ll x1,x2,y1,y2;
cin>>x1>>y1>>x2>>y2;
x1--;x2--;y1--;y2--;
bool p=true;
if(x2<x1 or y2<y1)
{
p=false;
}
else
{
for(ll i=x1;i<x2;i++)
{
ll start=0,meta=a[i].size()-1,s=(start+meta)/2;
while(start<meta)
{
if(a[i][s]<y1)
{
start=s+1;
}
else
{
meta=s;
}
s=(start+meta)/2;
}
if(a[i].size()>0)
{
if(a[i][s]>=y1 && a[i][s]<=y2)
{
y1=a[i][s];
}
else
{
p=false;
break;
}
}
else
{
p=false;
break;
}
}
}
if(p)
{
cout<<"Yes"<<endl;
}
else
{
cout<<"No"<<endl;
}
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
344 KB |
expected YES, found NO [1st token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
31 ms |
1884 KB |
expected YES, found NO [3rd token] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
3 ms |
856 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Runtime error |
2 ms |
600 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |