Submission #723614

# Submission time Handle Problem Language Result Execution time Memory
723614 2023-04-14T06:19:52 Z MurotY Hacker (BOI15_hac) C++14
0 / 100
1 ms 212 KB
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx,avx2")
#include <bits/stdc++.h>
#define ios ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz size()
using namespace std;
const double pi = 2 * acos(0.0);
const ll N=1e6+7, M=998244353;

ll a[N], pr[N];
void solve()
{
	int n;
	cin >> n;
	for (int i=0;i<n;i++) {
	     cin >> a[i];
		pr[i]=pr[max(0, i-1)]+a[i];
	}
	ll ans=0;
	for (int i=0;i<n;i++){
		int l=(n+1)/2, j=i;
		ll sum=0;
		while (l > 0){
			sum+=a[j], j++;
			if (j == n) j=0;
			l--;
		}
		ll sum1=0;
		l=(n+1)/2, j=i;
		while (l > 0){
			sum1+=a[j], j--;
			l--;
		}
		ans=max(ans, min(sum, sum1));
	}
	cout << ans;
	return ;
}
int main(){
	ios;
	int t=1;	
//	cin >> t;
	while (t--){ 
	    solve();
	    cout << "\n";
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -