QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#407329#7728. RamenduoxingyunWA 1ms3656kbC++17337b2024-05-08 15:46:592024-05-08 15:47:01

Judging History

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

  • [2024-05-08 15:47:01]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3656kb
  • [2024-05-08 15:46:59]
  • 提交

answer

#include<iostream>

using namespace std;

int n;
int a[100010];

int main(){
	
	cin >> n;
	
	long long sum = 0;
	
	for(int i = 1; i <= n; i++)
	{
		cin >> a[i];
		sum += a[i];
	}
	
	for(int i = 1; i <= n; i++)
	{
		sum -= a[i];
		if(sum > 0)
		{
			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: 1ms
memory: 3648kb

input:

3
1 2 -5

output:

Yes

result:

ok YES

Test #2:

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

input:

5
2 -5 2 3 1

output:

No

result:

ok NO

Test #3:

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

input:

5
3 -2 1 -1 -1

output:

Yes

result:

ok YES

Test #4:

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

input:

5
-1 100 100 100 100

output:

No

result:

ok NO

Test #5:

score: 0
Accepted
time: 1ms
memory: 3612kb

input:

5
3 -3 2 5 1

output:

No

result:

ok NO

Test #6:

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

input:

10
1 2 3 4 5 -15 100 200 300 100

output:

No

result:

ok NO

Test #7:

score: -100
Wrong Answer
time: 1ms
memory: 3648kb

input:

10
1 2 3 4 5 -14 100 200 300 100

output:

No

result:

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