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

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