| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
其实这个题真的很水.....贴个代码,不用那么长的#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator