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: 4ms
Memory: 1120kB
Author: 2018212212067
In contest: 1277

#include<stdio.h>
#include<stdlib.h>
int main()
{
	int i, n,result=0;
	int t,l=0;
	while(scanf("%d",&n)!=EOF)
	{
		result=0;l=0;
		for(i=0;i<n;++i)
		{
			scanf("%d",&t);
			l+=t<0?t:t/2;
			result+=l<0?1:0;
		}
		printf("%d\n",result);
	}
	return 0;
}