/*
ID: Sho10
LANG: C++
*/
#include <bits/stdc++.h> //Andrei Alexandru a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define endl '\n'
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll n,m,q,t,val;
pair<ll,ll>cod[200005];
int32_t main(){
CODE_START;
cin>>n>>m>>val;
for(ll i=0;i<val;i++)
{
cin>>cod[i].f>>cod[i].s;
}
ll xx,yy,xs,ys;
cin>>t;
sort(cod,cod+val);
while(t--){
cin>>xs>>ys>>xx>>yy;
ll mx=0;
ll l=0,r=val;
while(l<r){
ll mid=(l+r)/2;
if(cod[mid].f<xs){
l=mid+1;
}else if(cod[mid].f>xs){
r=mid-1;
}else if(cod[mid].f==xs&&cod[mid].s<ys){
l=mid+1;
}else if(cod[mid].f==xs&&cod[mid].s>yy){
r=mid-1;
}
}
ll mid=(l+r)/2;
if(cod[mid].f==xs&&cod[mid].s>=ys&&cod[mid].s<=yy){
cout<<"Yes"<<endl;
}else cout<<"No"<<endl;
}
}
Compilation message
trampoline.cpp: In function 'int32_t main()':
trampoline.cpp:38:7: warning: unused variable 'mx' [-Wunused-variable]
ll mx=0;
^~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2090 ms |
512 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2087 ms |
3448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2081 ms |
3448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2092 ms |
384 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2089 ms |
3448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |