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: 5ms
Memory: 1120kB
Author: 2018212212172
In contest: 1277

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n;
	int num;
	double sum=0;	
	int qiuzhangzhi=0;
	while(scanf("%d",&n)!=EOF)
	{
		sum=0;
		qiuzhangzhi=0;
		while(n--)
		{
			scanf("%d",&num);
			if(num<=0)
			{
				sum+=num;
			}
			else if(num>0)
			{
				if(num%2==0)
				{
					sum+=(num/2);
				}
				else 
				sum+=1.0*num/(2*1.0);
			}
			if(sum<0)
			{
				qiuzhangzhi++;
			}
		}
		printf("%d\n",qiuzhangzhi);
	}

	
}