QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#236272#7728. RamenAFLeartLey0103WA 1ms3548kbC++14300b2023-11-03 19:38:132023-11-03 19:38:15

Judging History

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

  • [2023-11-03 19:38:15]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3548kb
  • [2023-11-03 19:38:13]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int n;
  cin >> n;
  int init = 0;
  for(int i = 1, a; i < n; ++ i){
    cin >> a;
    init += a;
    if(init < 0){
      cout << "No\n";
      return 0;
    }
  }
  cout << "Yes\n";
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1 2 -5

output:

Yes

result:

ok YES

Test #2:

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

input:

5
2 -5 2 3 1

output:

No

result:

ok NO

Test #3:

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

input:

5
3 -2 1 -1 -1

output:

Yes

result:

ok YES

Test #4:

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

input:

5
-1 100 100 100 100

output:

No

result:

ok NO

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 3548kb

input:

5
3 -3 2 5 1

output:

Yes

result:

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