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: 8ms
Memory: 2016kB
Author: CT12810971281
In contest: 1281

#include<cstdio>
#include<iostream>
#include<iomanip>
#include<cmath>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
	int n,z;
	double sum=0,x;
	while(cin>>n){
		z=0;
		sum=0;
		for(int i=0;i<n;i++){
			cin>>x;
			if(x>0)	sum+=x/2;
			else
				sum+=x;
			if(sum<0)
				z++;
		}
		cout<<z<<endl;
	}
    //system("pause");
    return 0;
}