QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#240949#7728. RamenkarosWA 0ms3536kbC++14320b2023-11-05 21:14:432023-11-05 21:14:43

Judging History

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

  • [2023-11-05 21:14:43]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3536kb
  • [2023-11-05 21:14:43]
  • 提交

answer

#include <iostream>
using namespace std;

int main(){
    int n,sum=0;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++) cin>>arr[i];
    for (int i = 0; i < n; ++i) {
        if (sum+=arr[i]<=0 && i!=n-1){
            puts("NO");
            return 0;
        }
    }
    puts("YES");
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3492kb

input:

3
1 2 -5

output:

YES

result:

ok YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

5
2 -5 2 3 1

output:

NO

result:

ok NO

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3536kb

input:

5
3 -2 1 -1 -1

output:

NO

result:

wrong answer expected YES, found NO [1st token]