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: 2018212212006
In contest: 1277

#include<stdio.h>
#include<math.h>
int main()
{
	int t,i;
	double k;
	while(scanf("%d",&t)!=EOF)
	{ 
		int num=0;
		int num1=0;
	           for(i=0;i<t;i++)
			   {
				   scanf("%lf",&k);
			   if(k>0)
                          num=num+k/2;
			   else
				    num=num+k;
			   
			   if(num<0)
				   num1++;
			   }
                    printf("%d\n",num1);
	}
	return 0;
}