Submission #219933

#TimeUsernameProblemLanguageResultExecution timeMemory
219933Sho10Trampoline (info1cup20_trampoline)C++14
0 / 100
2092 ms3448 KiB
/* 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 (stderr)

trampoline.cpp: In function 'int32_t main()':
trampoline.cpp:38:7: warning: unused variable 'mx' [-Wunused-variable]
    ll mx=0;
       ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...