QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#240949 | #7728. Ramen | karos | WA | 0ms | 3536kb | C++14 | 320b | 2023-11-05 21:14:43 | 2023-11-05 21:14:43 |
Judging History
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]