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

#include<stdio.h>

int main(){
	int T;
	int luckyPoint,n;
	int total,ans;
	while(scanf("%d",&n)!=EOF){ 
		total=0;
			ans=0;
        while(n--){
           
			scanf("%d",&luckyPoint);
			if(luckyPoint>0){
				luckyPoint=luckyPoint/2;
				total+=luckyPoint;
		        
			}
			
			else{
                total+=luckyPoint;
			}
				
			if(total<0)
				ans+=1;
		}
		printf("%d\n",ans);
	}
	return 0;
}