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

#include<stdio.h>
#include<string.h>
#include<math.h>
int main(){
int a,b,c,d;

while(scanf("%d",&a)!=EOF){
	c=0,d=0;
while(a--)
	{scanf("%d",&b);
    if(b>0)
		c+=(0.5)*b;
	else
	   c=c+b;
	if(c<0)
		d++;}
printf("%d\n",d);}
 
return 0;}