# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
31577 | huynd2001 | Hacker (BOI15_hac) | C++14 | 59 ms | 9828 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*huypheu
4
6 8 4 7
*/
#include <bits/stdc++.h>
#define int long long
using namespace std;
int a[500007];
int su[500007];
signed main()
{
int n;
scanf("%lld",&n);
for(int i=1;i<=n;i++)
{
scanf("%lld",&a[i]);
}
int la=(n/2);
for(int i=1;i<=n;i++)
{
su[i]=su[i-1]+a[i];
}
int mi=0;
for(int i=2;i<=n-la+1;i++)
{
mi=max(mi,su[i+la-1]-su[i-1]);
}
printf("%lld",su[n]-mi);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |