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


#include <cstdio>
#include <algorithm>
#include <iostream>
#include<cstring>
#include<cmath>
#include<time.h>
using namespace std;
int main()
{
	int n,sum,a,ans;
	while(~scanf("%d",&n))
	{
		sum=0;ans=0;
		while(n--)
		{
			scanf("%d",&a);
			if(a>0)a=a/2;
			sum+=a;
			if(sum<0)
			{
				ans++;
			}
		}
		printf("%d\n",ans);
	}

}