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

#include<stdio.h>
#include<math.h>
int main(){
	int a,b,c,aa,bb;
	while(scanf("%d",&a)!=EOF){
		aa=0;bb=0;
		for(b=0;b<a;b++){
			scanf("%d",&c);
			if(c>0)c=c*0.5;
			aa=aa+c;
			if(aa<0)bb++;
		}
		printf("%d\n",bb);
	}
	return 0;
}