QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#48493 | #2283. Decelerating Jump | meliodas_mc | WA | 3ms | 3828kb | C++ | 996b | 2022-09-14 06:34:22 | 2022-09-14 06:34:23 |
Judging History
answer
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
int n, i, a, j, sum, first, last, higer = -100000, 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] = -100000;
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;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3828kb
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: 3708kb
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: 0ms
memory: 3724kb
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'