QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#239082#7728. RamendownpourWA 0ms3708kbC++20378b2023-11-04 18:23:542023-11-04 18:23:55

Judging History

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

  • [2023-11-04 18:23:55]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3708kb
  • [2023-11-04 18:23:54]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n, s = 0, ok = 1;
    cin >> n;
    for (int i = 1, x; i < n; i++)
    {
        cin >> x, s += x;
        if (s < 0)
        {
            ok = 0;
            break;
        }
    }
    cout << (ok ? "Yes\n" : "No\n");

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1 2 -5

output:

Yes

result:

ok YES

Test #2:

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

input:

5
2 -5 2 3 1

output:

No

result:

ok NO

Test #3:

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

input:

5
3 -2 1 -1 -1

output:

Yes

result:

ok YES

Test #4:

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

input:

5
-1 100 100 100 100

output:

No

result:

ok NO

Test #5:

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

input:

5
3 -3 2 5 1

output:

Yes

result:

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