Submission #365952

#TimeUsernameProblemLanguageResultExecution timeMemory
365952Ahmadsm2005Trampoline (info1cup20_trampoline)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define endl '\n' #define modulo 998244353 //#define int long long #define PI acos(-1) #pragma GCC optimize("-Ofast") //#pragma GCC optimize("trapv") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.2,popcnt,abm,mmx,avx2,tune=native") #pragma GCC optimize("-ffast-math") #pragma GCC optimize("-funroll-loops") #pragma GCC optimize("-funroll-all-loops,-fpeel-loops,-funswitch-loops") #define sinDegrees(x) sin((x) * PI / 180.0) #define cosDegrees(x) cos((x) * PI / 180.0) #define tanDegrees(x) tan((x) * PI / 180.0) #define atanDegrees(x) atan(x)* 180.0 / PI #define asinDegrees(x) asin(x)* 180.0 / PI #define EPS 0.000000001 using namespace std; int power(int x,int y,int m) { int temp; if(y == 0) return 1; temp = (power(x, y/2,m))%m; if (y%2 == 0) return ((temp%m)*temp); else return ((x*temp%m)*temp%m)%m; } int inv(int x,int m=modulo) { return (power(x,m-2,m))%m; } ///IOI 2021 isA int R,C,N,T,X,Y,X2,Y2; vector<pair<int,int>>lolz; int32_t main() { //freopen("output.txt","w",stdout); //freopen("sorting.in","r",stdin); cin.tie(0),iostream::sync_with_stdio(0); cin>>R>>C>>N; for(int i=0;i<N;i++){ cin>>Y>>X; lolz.push_back({Y,X}); } sort(lolz.begin(),lolz.end()); cin>>T; while(T--){ cin>>Y>>X>>Y2>>X2; int LAST=0,FFF=0; if(Y2<Y){ cout<<"NO"<<endl; goto a; } for(int i=Y;i<Y2;i++){ int L=0,R=N-1,mid,BEST=INT_MAX; while(L<=R){ mid=(L+R)/2; if(lolz[mid].first<i) L=mid+1; else if(lolz[mid].first>i) R=mid-1; else if(lolz[mid].second<LASTX) L=mid+1; else BEST=min(BEST,lolz[mid].second),R=mid-1; } LASTX=BEST; } //cout<<LASTX<<endl; if(LASTX<=X2){ cout<<"YES"<<endl; } else cout<<"NO"<<endl; a:; } return 0; }

Compilation message (stderr)

trampoline.cpp: In function 'int32_t main()':
trampoline.cpp:64:26: error: 'LASTX' was not declared in this scope; did you mean 'LAST'?
   64 | else if(lolz[mid].second<LASTX)
      |                          ^~~~~
      |                          LAST
trampoline.cpp:69:1: error: 'LASTX' was not declared in this scope; did you mean 'LAST'?
   69 | LASTX=BEST;
      | ^~~~~
      | LAST
trampoline.cpp:72:4: error: 'LASTX' was not declared in this scope; did you mean 'LAST'?
   72 | if(LASTX<=X2){
      |    ^~~~~
      |    LAST
trampoline.cpp:51:5: warning: unused variable 'LAST' [-Wunused-variable]
   51 | int LAST=0,FFF=0;
      |     ^~~~
trampoline.cpp:51:12: warning: unused variable 'FFF' [-Wunused-variable]
   51 | int LAST=0,FFF=0;
      |            ^~~