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: 2018212212130
In contest: 1277

#include<bits/stdc++.h>
using namespace std;
int  main ()
{
	int a[1000];
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		int ans=0;
		for(int i=0;i<n;++i)
		{
			scanf("%d",&a[i]);
		}
		for(int i=0;i<n;++i)
		{
			if(a[i]>0)
			a[i]=a[i]/2;
		}
		int t=0;
		for(int i=0;i<n;++i)
		{
			ans+=a[i];
			if(ans<0)
			t++;
		}
		printf("%d\n",t);
	}
}