#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5+10;
int vet[MAXN];
int main(){
int n, k, resp=0x3f3f3f3f;
cin >> n;
k = ceil((double)n/2);
for(int i=1; i<=n; i++){
cin >> vet[i];
}
for(int i=1; i<=k; i++){
int u=i, x=1, sum=0;
while(x<=k){
sum+=vet[u];
u--;
x++;
if(u==0)u=n;
}
resp=min(resp,sum);
}
cout << resp << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
384 KB |
Output is correct |
3 |
Correct |
10 ms |
384 KB |
Output is correct |
4 |
Execution timed out |
1058 ms |
896 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |