| ||||||||||
| 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 | |||||||||
那个牛人能帮我看看,真是不知道哪错了。。。1000过了,真的能AC?#include<stdio.h>
void main()
{
int a[10],i,j,l1,l2,m,b[4]={0,5,3,1};
for(j=0;j<10000;j++)
{
for(i=1;i<7;i++)
{
m=0;
scanf("%d",&a[i]);
}
if(a[1]+a[2]+a[3]+a[4]+a[5]+a[6]==0)
{j=10002;}
else
{
m=a[6]+a[5]+a[4]+(a[3]+3)/4;
l2=a[4]*5+b[a[3]%4];
if(a[2]<=l2)
{
l1=m*36-a[6]*36-a[5]*25-a[4]*16-a[3]*9-a[2]*4;
if(a[1]<=l1)
{
printf("%d\n",m);
}
else
{
if((a[1]-l1)%36==0)
{
m=m+(a[1]-l1)/36;
}
else
{
m=m+(a[1]-l1)/36+1;
}
printf("%d\n",m);
}
}
else
{
m=m+(a[2]-l2)/9+1;
l1=m*36-a[6]*36-a[5]*25-a[4]*16-a[3]*9-a[2]*4;
if(a[1]<=l1)
{
printf("%d\n",m);
}
else
{
if((a[1]-l1)%36==0)
{
m=m+(a[1]-l1)/36;
}
else
{
m=m+(a[1]-l1)/36+1;
}
printf("%d\n",m);
}
}
}
}
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator