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

#include<stdio.h>
int main (){
	int n,t,i,m,a1,a2;
	while(scanf("%d",&t)!=EOF){
		a1=0;a2=0;
		for(i=0;i<t;i++){
			scanf("%d",&m);
			if(m>0)
			a1=a1+m/2;
			else a1=a1+m;
			if(a1<0)
			a2=a2+1;
		}
		printf("%d\n",a2);
	}
	return 0;
}