Start: Jul, 05, 2019 08:40:00
2019年度暑期短学期达标测试
End: Jul, 05, 2019 11:40:00
Time elapsed:
Time remaining:

Problem_ID: C
Result: Accepted
Time: 4ms
Memory: 1120kB
Author: CT12811001281
In contest: 1281

#include<stdio.h>
#include<math.h>
#include<string.h>
int main(void){
	 int a,b,c,d;
	 while(scanf("%d",&a)!=	EOF){
		 c=0;d=0;
		 while(a--){
			 scanf("%d",&b);
			 if(b>0)
				 c=c+(0.5)*b;
			 else c=c+b;
			 if(c<0)d++;}
		 printf("%d\n",d);}
	 return 0;}