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: 6ms
Memory: 1784kB
Author: 2018212212134
In contest: 1277

#include <stdio.h>
#include <math.h>
#include <string.h>

int main(){
	int i,n,dig;
	double point;
	double a[99999];
	while(scanf("%d",&n)!=EOF)
	{
		point=0;
		dig = 0;
		for(i=0;i<n;++i)
		{
			scanf("%lf",&a[i]);
			if(a[i]>0)
				point = point + (a[i]/2);
			else
				point += a[i];
			if(point<0)
				dig++;
			
		}
		printf("%d\n",dig);
	}
}