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

#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<cmath>

using namespace std;

int main()
{
	int N,i,a[11111];
	while(scanf("%d",&N)!=EOF)
	{
		int count=0;
		int ans=0;
		for(i=0;i<N;++i)
		{
			scanf("%d",&a[i]);
			if(a[i]<0)
			{
				ans+=a[i];
			}
			if(a[i]>0)
			{
				ans+=(a[i]/2);
			}
			if(ans<0)
			count++;
		}
		printf("%d\n",count);
		
	}
}