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: CT12812861281
In contest: 1281

#include <cstdio>
#include <iostream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cmath>
using namespace std;
int t,n;
int main()
{
	while(~scanf("%d",&n))
	{
		double sum=0;
		int cnt=0;
		for(int i=0;i<n;i++)
		{
			scanf("%d",&t);
			if(t>0)
				sum+=t/2;
			else
				sum+=t;
			if(sum<0)
				cnt++;
		}
		cout<<cnt<<endl;
	}
}