Submission #923369

#TimeUsernameProblemLanguageResultExecution timeMemory
923369XiaoyangAdvertisement 2 (JOI23_ho_t2)C++17
0 / 100
21 ms456 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define fi first #define se second #define pii pair<int,int> #define pll pair<long long,long long> #define pb push_back #define debug(x) cerr<<#x<<"="<<x<<endl #define pq priority_queue #define inf 1ll<<60 #define rep(i,a,b) for (ll i=a;i<(b);i++) #define MP make_pair #define SZ(x) (int(x.size())) #define mod 1000000007 #define ALL(x) x.begin(),x.end() #define endl "\n" void inc(ll &a,ll b) {a=(a+b)%mod;} void dec(ll &a,ll b) {a=(a-b+mod)%mod;} int prod(ll a,ll b) {return ll(a)*ll(b)%mod;} int lowbit(ll x) {return x&(-x);} ll p0w(ll base,ll p) {ll ret=1;while(p>0){if (p%2ll==1ll) ret=ret*base%mod;base=base*base%mod;p/=2ll;}return ret;} signed main(){ ios::sync_with_stdio(false); cin.tie(0); ll n;cin>>n; stack<pll>s; bool flag; rep(i,0,n){ ll x,y;cin>>x>>y; flag=true; while(!s.empty()){ ll dx=s.top().fi; ll 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; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...