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

#include<stdio.h>
int n;
int main(){

	double xingyunzhi,bushu,sum,qiuzhangzhi;
	while(scanf("%d",&n)!=EOF){
		qiuzhangzhi=0;
			sum=0;
		for(int i=0;i<n;i++){
		
			scanf("%lf",&xingyunzhi);
	
			if(xingyunzhi>=0){
				xingyunzhi=xingyunzhi/2*1.0;
				sum=sum+xingyunzhi;
			}
			if(xingyunzhi<0){
				sum=sum+xingyunzhi;
			}
			if (sum<0){
				qiuzhangzhi++;
			}
		}
		printf ("%.0lf\n",qiuzhangzhi);
	}

	return 0;
}