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: 4ms
Memory: 2016kB
Author: CT12810341281
In contest: 1281

#include<bits/stdc++.h>
using namespace std;

int main()
{
	int n;
	while(scanf("%d",&n) != EOF)
	{
		int ans = 0;
		int xy = 0;
		int arr;
		while(n--)
		{
			scanf("%d",&arr);
			if(arr > 0)
				arr /= 2;
			xy += arr;
			if(xy < 0)
				ans ++;
		}
		printf("%d\n",ans);
	}
	return 0;
}