QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#407342#7728. Ramensdutcm_zcyRE 1ms3664kbC++11268b2024-05-08 16:10:082024-05-08 16:10:09

Judging History

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

  • [2024-05-08 16:10:09]
  • 评测
  • 测评结果:RE
  • 用时:1ms
  • 内存:3664kb
  • [2024-05-08 16:10:08]
  • 提交

answer

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1 2 -5

output:

Yes

result:

ok YES

Test #2:

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

input:

5
2 -5 2 3 1

output:

No

result:

ok NO

Test #3:

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

input:

5
3 -2 1 -1 -1

output:

Yes

result:

ok YES

Test #4:

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

input:

5
-1 100 100 100 100

output:

No

result:

ok NO

Test #5:

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

input:

5
3 -3 2 5 1

output:

No

result:

ok NO

Test #6:

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

input:

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

output:

No

result:

ok NO

Test #7:

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

input:

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

output:

Yes

result:

ok YES

Test #8:

score: -100
Runtime Error

input:

99994
10158 8007 -9962 16609 -8963 14302 19425 11985 13981 -979 -745 19900 -13546 10379 -9187 19083 -6575 -10263 6492 12375 -19156 2959 8395 2133 -745 10010 -7647 17523 -920 19590 -5036 -7383 -16011 13687 18845 -4718 -16154 11768 -9905 9707 10354 18859 -7034 2037 -4213 13330 3395 -90 19861 -10341 14...

output:

No

result: