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

#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
	int n;
	while(cin >> n)
	{
		int ans=0;
		double now=0;
		for (int i=0;i<n;i++)
		{
			int tmp;
			cin >> tmp;
			now+= tmp>0 ? tmp/2.0 : tmp;
			if (now<0)
				ans++;
		}
		cout << ans << endl;
	}
	
}