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: 1120kB
Author: 2018212212200
In contest: 1277

#include<stdio.h>
int main()
{
	int q,x;
	int n,m;
	while(scanf("%d",&n)!=EOF)
	{
		q=0;
		x=0;
		while(n--)
		{
			scanf("%d",&m);
			if(m>0)
				x+=m/2;
			else
				x+=m;
			if(x<0)
				q+=1;
		}
		printf("%d\n",q);
	}
	return 0;
}