Submission #923361

#TimeUsernameProblemLanguageResultExecution timeMemory
923361XiaoyangAdvertisement 2 (JOI23_ho_t2)C++17
0 / 100
6 ms2104 KiB
#pragma optimization_level 3 #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx") #pragma GCC optimize("Ofast")//Comment optimisations for interactive problems (use endl) #pragma GCC target("avx,avx2,fma") #include<bits/stdc++.h> using namespace std; #define fi first #define se second #define pii pair<int,int> #define pll pair<long long,long long> #define pb push_back #define pq priority_queue #define rep(i,a,b) for (int i=a;i<(b);i++) #define MP make_pair #define int long long #define ll long long #define ALL(x) x.begin(),x.end() inline int readInt() { int x = 0; char ch = getchar(); while (ch < '0' || ch > '9') ch = getchar_unlocked(); while (ch >= '0' && ch <= '9'){ x = (x << 3) + (x << 1) + ch - '0'; ch = getchar_unlocked(); } return x; } signed main(){ ios::sync_with_stdio(false); cin.tie(0); int n,x,y; n=readInt(); stack<pii>s; bool flag; rep(i,0,n){ x=readInt(); y=readInt(); flag=true; while(!s.empty()){ int dx=s.top().fi; int dy=s.top().se; if(x-dx<=dy-y){ flag=false;break; } if(x-dx<=y-dy)s.pop(); else{break;} } if(flag){ s.push({x,y}); } } cout<<s.size(); return 0; }

Compilation message (stderr)

Main.cpp:1: warning: ignoring '#pragma optimization_level ' [-Wunknown-pragmas]
    1 | #pragma optimization_level 3
      |
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...