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: 4ms
Memory: 1392kB
Author: CT12811071281
In contest: 1281

#include <stdio.h>
int main(){
	int n,c;
	double sum;
	int a[100000];
	while(scanf("%d",&n)!=EOF){
		sum=0;
		c=0;
		for(int i=0;i<n;i++){
			scanf("%d",&a[i]);
		}
		for(int j=0;j<n;j++){
			if(a[j]<=0){
				sum=sum+a[j];
			}else{
				sum=(double)a[j]/2.0+sum;
			}

			if(sum<0){
				c++;
			}
		}
		printf("%d\n",c);
	}
	return 0;
}