Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 5ms
Memory: 1392kB
Author: CT12810931281
In contest: 1281

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