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: 1120kB
Author: CT12810281281
In contest: 1281

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