제출 #961461

#제출 시각아이디문제언어결과실행 시간메모리
961461vjudge1Lightning Rod (NOI18_lightningrod)C++17
44 / 100
1235 ms216660 KiB
#include <bits/stdc++.h> #pragma optimize("Ofast") #pragma target("avx2") using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define pii pair<int,int> #define all(v) v.begin(),v.end() #define F first #define S second #define mem(a,i) memset(a,i,sizeof(a)) #define sz(s) (int)s.size() #define y1 yy #define ppb pop_back #define lb lower_bound #define ub upper_bound #define gcd(a,b) __gcd(a,b) #define in insert // #define int ll const int MAX=5e5+5; const int B=90; const int N=105; const int block=400; const int maxB=MAX/B+10; const ll inf=2e18; const int mod=998244353; const int mod1=1e9+9; const ld eps=1e-9; int dx[8]={1,0,-1,0,1,-1,-1,1}; int dy[8]={0,1,0,-1,1,-1,1,-1}; int binpow(int a,int n){ if(!n)return 1; if(n%2==1)return a*binpow(a,n-1)%mod; int k=binpow(a,n/2); return k*k%mod; } int n; vector<pii> v; void solve(){ cin>>n; int mx=0; ll px=-inf,py=-inf; for(int i=1;i<=n;i++){ int x,y; cin>>x>>y; if(px==x){ if(y>py){ v[sz(v)-1]={x+y,x-y}; mx=max(mx,x+y); } } else if(x+y>=mx){ v.pb({x+y,-x+y}); mx=x+y; } px=x,py=y; } int ans=0; for(int i=sz(v)-1;i>=0;i--){ if(-v[i].S<mx){ mx=-v[i].S; ans++; } } cout<<ans; } signed main(){ // freopen("help.in","r",stdin); // freopen("help.out","w",stdout); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); // prec(); int t=1; // cin>>t; while(t--)solve(); }

컴파일 시 표준 에러 (stderr) 메시지

lightningrod.cpp:3: warning: ignoring '#pragma optimize ' [-Wunknown-pragmas]
    3 | #pragma optimize("Ofast")
      | 
lightningrod.cpp:4: warning: ignoring '#pragma target ' [-Wunknown-pragmas]
    4 | #pragma target("avx2")
      |
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...