Start: Jul, 01, 2019 08:30:00
2019年度暑期短学期第四天
End: Jul, 01, 2019 11:30:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 4ms
Memory: 1392kB
Author: 2018212212209
In contest: 1277

#include<stdio.h>
int main()
{
	int n,a[100002],i;
	double total;
	int t;
	while(scanf("%d",&n)!=EOF)
	{
		total=0;
		t=0;
	for(i=1;i<=n;++i)
	{
		scanf("%d",&a[i]);
	}
	for(i=1;i<=n;++i)
	{
		if(a[i]<0)
		{

			total=total+a[i];
			
		}
		else
		{
			total=total+(a[i]*1.0/2);

		}

		
		if(total<0)
			t++;


	}
	printf("%d\n",t);
	}

}