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: 6ms
Memory: 1756kB
Author: 2018212212137
In contest: 1277

#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n,a;
	while(cin>>n)
	{
		int sum1=0,k=0;
		while(n--)
		{
			cin>>a;
			if(a>0)	sum1+=(a/2);
			if(a<0)	sum1+=a;
			if(sum1<0)	k+=1;
		}
		cout<<k<<endl;
	}
	//system("pause");
}