QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#243392 | #7728. Ramen | tnos | WA | 1ms | 3572kb | C++14 | 419b | 2023-11-08 09:55:51 | 2023-11-08 09:55:51 |
Judging History
answer
#include<bits/stdc++.h>
#define Yukinoshita namespace
#define Yukino std
using Yukinoshita Yukino;
int read()
{
int s=0,w=1;
char ch=getchar();
while(ch<'0'||ch>'9') w=ch=='-'?-1:1,ch=getchar();
while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
return s*w;
}
int main()
{
int n=read();
long long s=0;
for(n--;n--;)
if((s+=read())<0)
{
puts("No");
return 0;
}
puts("Yes");
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3524kb
input:
3 1 2 -5
output:
Yes
result:
ok YES
Test #2:
score: 0
Accepted
time: 0ms
memory: 3364kb
input:
5 2 -5 2 3 1
output:
No
result:
ok NO
Test #3:
score: 0
Accepted
time: 0ms
memory: 3384kb
input:
5 3 -2 1 -1 -1
output:
Yes
result:
ok YES
Test #4:
score: 0
Accepted
time: 0ms
memory: 3516kb
input:
5 -1 100 100 100 100
output:
No
result:
ok NO
Test #5:
score: -100
Wrong Answer
time: 1ms
memory: 3572kb
input:
5 3 -3 2 5 1
output:
Yes
result:
wrong answer expected NO, found YES [1st token]