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: 1756kB
Author: CT12810761281
In contest: 1281

#include<iostream>
#include<cmath>
#include<string>
#include<string.h>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int n,s0=0;
	double s=0;
	int a[10000];
	while(scanf("%d",&n)!=EOF){
		s=0;
		s0=0;
		for(int i=0;i<n;++i){
			scanf("%d",&a[i]);
		}
		for(int i=0;i<n;++i){
			if(a[i]>0){
			s+=a[i]/2.0;
			}
			else 
			s+=a[i];
			if(s<0) ++s0;
		}
		printf("%d\n",s0);
	}
	return 0;
}