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

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