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: 1388kB
Author: CT12810111281
In contest: 1281

#include<stdio.h>
int main(){
	int a,b,c;
	int aa[99999];
	while(~scanf("%d",&a)){
		int bb=0;
		int cc=0;
		for(b=0;b<a;b++){
			scanf("%d",&aa[b]);
		}
		bb=aa[0];
		if(bb<0){
			cc++;
		}
		else bb=aa[0]/2.0;
		for(c=1;c<a;c++){
			if(aa[c]<0){
				bb=bb+aa[c];
				if(bb<0)cc++;
			}
			else{
				bb=bb+aa[c]/2.0;
				if(bb<0)cc++;
		}
		}
		printf("%d\n",cc);
	}
}