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: 10ms
Memory: 1756kB
Author: 2018212212289
In contest: 1277

#include<bits/stdc++.h>
using namespace std;
int main (){
	int n,s,a,sum;
	while(cin>>n){
		sum=0;
		s=0;
		for(int i=0;i<n;++i){
			cin>>a;
			if(a>0)
			a/=2;
			s+=a;
			if(s<0)
			++sum;
		}
		cout<<sum<<endl;
	}
	return 0;
}