QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#243392#7728. RamentnosWA 1ms3572kbC++14419b2023-11-08 09:55:512023-11-08 09:55:51

Judging History

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

  • [2023-11-08 09:55:51]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3572kb
  • [2023-11-08 09:55:51]
  • 提交

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]