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

#include<stdio.h>
int main(){
	int n,x,flag=0,sum=0;
	while(scanf("%d",&n)!=EOF){
	while(n--){
		scanf("%d",&x);
		if(x<0)
		sum+=x;
		else
		sum+=(x/2);
		if(sum<0)
		flag++;
	}
	printf("%d\n",flag);
	flag=0;
	sum=0;
}
	return 0;
}