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: 1120kB
Author: 2017211401098
In contest: 1277

#include<stdio.h>

void main(){
	int q,all,n,s;
	while(scanf("%d",&n)!=EOF){
		all=0;
		q=0;
		while(n--){
			scanf("%d",&s);
			if(s>0)
				all=all+s/2;
			else
				all=all+s;
			if(all<0)
				q++;
		}
		printf("%d\n",q);
	}
}