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: 5ms
Memory: 1120kB
Author: CT12810161281
In contest: 1281

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


return 0;}