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

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>
int main(){
	int n;
	while(scanf("%d",&n)!=EOF){
		int a[10000]={0},i,count=0;
		double z=0;
		for(i=0;i<n;i++){
		   scanf("%d",&a[i]);
		}
		for(i=0;i<n;i++){
			if(a[i]>0){
			   z+=a[i]*0.5;
			}
			else
				z+=a[i];
			if(z<0)
				count++;
		}
		printf("%d\n",count);
	}
}