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

Problem_ID: C
Result: Accepted
Time: 5ms
Memory: 1120kB
Author: CT12812731281
In contest: 1281

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include<stdio.h>
int n;
int main(){
	while(~scanf("%d",&n)){
		int time=0;
		int sum=0;
		for(int i=0;i<n;i++){
			int a;
			scanf("%d",&a);
			if(a>0)a/=2;
			sum+=a;
			if(sum<0)time++;
		}
		printf("%d\n",time);
	}
}