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

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