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: 5ms
Memory: 1120kB
Author: 2018212212186
In contest: 1277

#include<stdio.h>
int main()
{
	int n;
	double number[10000];
	while(scanf("%d",&n)!=EOF){
		int i,count=0;
		double num=0;
		for(i=0;i<n;i++){
			scanf("%lf",&number[i]);
		}
		for(i=0;i<n;i++){
			if(number[i]>0){
				num=num+number[i]/2;
			}else{
				num=num+number[i];
			}
			if(num<0){
				count++;
			}
		}
		printf("%d\n",count);
	}
	return 0;
}