Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

其实这个题真的很水.....贴个代码,不用那么长的

Posted by bitchen at 2010-12-30 20:32:49 on Problem 1017 and last updated at 2010-12-30 20:33:27
#include<stdio.h>
int main(){
	int n,a,b,c,d,e,f,x,y;
	int u[4]={0,5,3,1};
	while(1){
		scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);
		if(a==0&&b==0&&c==0&&d==0&&e==0&&f==0)
			break;
		n=d+e+f+(c+3)/4;
		y=5*d+u[c%4];
		if(b>y)
			n+=(b-y+8)/9;
		x=36*n-36*f-25*e-16*d-9*c-4*b;
		if(a>x)
			n+=(a-x+35)/36;
		printf("%d\n",n);
	}
	return 0;
}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator