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: 2018212212301
In contest: 1277

#include<stdio.h>
#include<math.h>
#include<stdlib.h>
#include<string.h>

int main(){
	long long int n;
	while(scanf("%lld", &n)!=EOF){
		double a[n+10];
		int i = 0;
		int num = 0;
		double sum = 0;
		for(i = 0; i < n ; i++){
			scanf("%lf", &a[i]);
			if( a[i] > 0 ){
				sum += (a[i]/2.0);
			} else {
				sum += a[i];
			}
			if(sum < 0){
				num += 1;
			}
		}
		printf("%d\n", num);
	}
	return 0;
}