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

#include<stdio.h>

int main(){
	int n,i,sum=0,count=0,s,x;
	while(scanf("%d",&n)!=EOF){
	count=0;
    s=0;sum=0;
		for(x=0;x<n;x++){
		scanf("%d",&i);
		if(i>0){
			i=i/2;
		}
		else if(i<=0){
			i=i;
		}
	sum+=i;
	if(sum<0){
				count+=1;
	}
	else if(sum>=0){
				count+=0;
    }
	}
    s+=count;
    printf("%d\n",s);
    
    }
    return 0;
}