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

#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int n;
	while (cin >> n)
	{
		int ans = 0;
		double sum = 0;
		for (int i = 0; i < n; i++)
		{
			double t;
			cin >> t;
			if (t < 0)
				sum += t;
			else
				sum += (t / 2);
			if (sum < 0)
				ans++;
			//printf("sum:%lf\n", sum);
		}
		printf("%d\n", ans);
	}
	return 0;
}