QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#407330#7728. Ramensdutcm_zcyWA 0ms3648kbC++11321b2024-05-08 15:47:042024-05-08 15:47:06

Judging History

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

  • [2024-05-08 15:47:06]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-05-08 15:47:04]
  • 提交

answer

#include<iostream>
using namespace std;
int main()
{
	int n;
	cin >>n;
	int sum = 0;
	int arr[100];
	for(int i =0;i<n;i++)
		{
			cin>>arr[i];
			sum+=arr[i];
		}
	for(int i =0;i<n-1;i++)
	{
		sum-=arr[i];
		if(sum>0)
			{
			cout<<"No"<<endl;
			return 0;
			}
	}
	cout<<"Yes"<<endl;
	return 0;
}

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3648kb

input:

3
1 2 -5

output:

Yes

result:

ok YES

Test #2:

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

input:

5
2 -5 2 3 1

output:

No

result:

ok NO

Test #3:

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

input:

5
3 -2 1 -1 -1

output:

Yes

result:

ok YES

Test #4:

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

input:

5
-1 100 100 100 100

output:

No

result:

ok NO

Test #5:

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

input:

5
3 -3 2 5 1

output:

No

result:

ok NO

Test #6:

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

input:

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

output:

No

result:

ok NO

Test #7:

score: -100
Wrong Answer
time: 0ms
memory: 3608kb

input:

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

output:

No

result:

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