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: 1392kB
Author: 2018212212320
In contest: 1277

#include<stdio.h>
int main(){
	int n,x,i;
	int a[100002];
	while(scanf("%d",&n)!=EOF){
		x=0;
		for(i=0;i<n;++i){
			scanf("%d",&a[i]);
		}
		for(i=0;i<1;++i){
			if(a[0]<0)
			x+=1;
			else
			a[0]/=2;
		}
		for(i=1;i<n;++i){
			if(a[i]>0)
			a[i]=a[i-1]+a[i]/2;
			else
			a[i]=a[i-1]+a[i];
			if(a[i]<0){
				x+=1;
			}
		}
		printf("%d\n",x);
	}
	return 0;
}