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

#include <stdio.h>
#include <math.h>
int main(){
	int n,step,sum=0,qzz=0;
	while(scanf("%d",&n)!=EOF){
		sum=0;
		qzz=0;
		getchar();
		while(n>0){
			scanf("%d",&step);
			if(step>0){
				step=step/2;
			}	
			sum=sum+step;
			if(sum<0){
				qzz+=1;
			}
			n--;
		}
		printf("%d\n",qzz);
	}
    return 0;
}