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: CT12810431281
In contest: 1281

#include<stdio.h>
int main(){
   int n;
   while(scanf("%d",&n)!=EOF){
   	float temp=0;
   	int temp1=0;
   	int a[1000];
   	int i;
   	for(i=0;i<n;i++){
   		scanf("%d",&a[i]);
	   }
	for(i=0;i<n;i++){
		if(a[i]>=0){
			if(a[i]%2==1){
			temp=a[i]/2+0.5+temp;}
			if(a[i]%2==0){
			temp=a[i]/2+temp;	
			}
			
		}
		if(a[i]<0){
			temp=temp+a[i];
		}
		if(temp<0){
			temp1=temp1+1;
		}
		
	}   
	printf("%d\n",temp1);
	temp=0;temp1=0;
   	
   } 
   return 0;	
}