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: 7ms
Memory: 1756kB
Author: CT12811941281
In contest: 1281

#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<map>
#include<math.h>
#include<map>
using namespace std;
const int maxn=100020;
const int inf=0x3f3f3f;
int main(){
	int n;
	int a;
	int t=0;
	int cnt=0;
	while(cin>>n){
		t=0;
		cnt=0;
		while(n--){
			cin>>a;
			if(a>0) a/=2;
			t+=a;
			if(t<0) cnt++;
		}
		cout<<cnt<<endl;
	}
	
}