QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#48491#2283. Decelerating Jumpmeliodas_mcWA 3ms3756kbC++958b2022-09-14 06:32:022022-09-14 06:32:03

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-09-14 06:32:03]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:3756kb
  • [2022-09-14 06:32:02]
  • 提交

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];

        }
    }

    printf("%i\n", higer+first+last);

    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 3756kb

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: 3684kb

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: 3ms
memory: 3700kb

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'