답안 #219933

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
219933 2020-04-06T17:15:28 Z Sho10 Trampoline (info1cup20_trampoline) C++14
0 / 100
2000 ms 3448 KB
/*
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;
       ^~
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2090 ms 512 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2087 ms 3448 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2081 ms 3448 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2092 ms 384 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2089 ms 3448 KB Time limit exceeded
2 Halted 0 ms 0 KB -