Start: Jun, 28, 2019 13:00:00
2019年度暑期短学期第四天-助教场
End: Jun, 30, 2019 23:59:00
Time elapsed:
Time remaining:

Problem_ID: D
Result: Accepted
Time: 10ms
Memory: 1712kB
Author: 2018212212059
In contest: 1289

#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <deque>
#define clr(a,b) memset(a,b,sizeof(a))
#define ll long long

using namespace std;

const int maxn=1e3+10;
int n;

int main()
{
	while(scanf("%d",&n)!=EOF)
	{
		double ans=0,a,tot=0;
		while(n--)
		{
			cin>>a;
			if(a<=0)ans+=a;
			else ans+=a/2;
			if(ans<0)tot++;
		}
		cout<<tot<<endl;
	}
}