QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#48494 | #2283. Decelerating Jump | meliodas_mc | WA | 3ms | 3752kb | C++ | 1010b | 2022-09-14 06:35:54 | 2022-09-14 06:35:57 |
Judging History
answer
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int n, i, a, j, sum, first, last, higer = -1000000000, x;
scanf("%i", &n);
/*
if(n > 2){
x = n;
}else{
x =
}*/
int bloques[n-2], sumas[((n-2)/2)+1];
scanf("%i", &first);
sumas[0] = -1000000000
;
for(i = 1; i<n-1; i++){
scanf("%i", &a);
//bloques[i] = a;
if(i<=((n-2)/2)){
sumas[i] = a;
}
else{
if(a>sumas[0]){
sumas[0] = a;
}
}
for(j = i/2; j>0; j--){
if(!((i%(j+1)))){
sumas[j]+=a;
}
}
}
scanf("%i", &last);
for(i = 0; i<((n-2)/2)+1; i++){
if(sumas[i] > higer){
higer = sumas[i];
}
}
if(n <= 2){
higer = 0;
}
printf("%i\n", higer+first+last);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3752kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
2
result:
ok single line: '2'
Test #2:
score: 0
Accepted
time: 3ms
memory: 3740kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
3
result:
ok single line: '3'
Test #3:
score: -100
Wrong Answer
time: 1ms
memory: 3748kb
input:
1000 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
output:
4
result:
wrong answer 1st lines differ - expected: '7', found: '4'