QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#239082 | #7728. Ramen | downpour | WA | 0ms | 3708kb | C++20 | 378b | 2023-11-04 18:23:54 | 2023-11-04 18:23:55 |
Judging History
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]