제출 #1225009

#제출 시각아이디문제언어결과실행 시간메모리
1225009jellybeanHacker (BOI15_hac)C++20
40 / 100
1094 ms3648 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back #define dd(x) cout<<#x<<" is "<<x<<endl; #define dd2(x,y) cout<<#x<<" is "<<x<<" "<<#y<<" is "<<y<<endl; #define dl(x) cout<<#x<<" is "<<endl; for(int i=1; i<9; i++) cout<<x[i]<<' '; cout<<endl; #define fi first #define se second typedef pair<int,int> pii; const int N = 5e5+5; int a[N]; int b[N*2]; int p[N*2]; deque<int>v; signed main(){ ios::sync_with_stdio(0); cin.tie(0); int n; cin>>n; for(int i=1; i<=n; i++) cin>>a[i]; v.pb(0); //placeholder for 1 index for(int i=1; i<=n; i++) v.pb(a[i]); for(int i=1; i<=n; i++) v.pb(a[i]); int ans = 0; for(int x=1; x<=n; x++){ //dl(v) for(int i=1; i<=2*n; i++) p[i] = p[i-1]+v[i]; int val = LLONG_MAX; for(int i=n+1; i<=n+(n+1)/2; i++){ int j = i-(n+1)/2; //dd2(p[i],p[j]) val = min(val,p[i]-p[j]); } ans = max(ans,val); v.pop_front(); v.pb(v.front()); v.pop_front(); v.push_front(0); } cout<<ans; 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...