| ||||||||||
| 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 | |||||||||
你这不超才怪。。。In Reply To:哪位大侠帮我改改程序,运行超时了 Posted by:OUmaster at 2006-07-04 10:41:16 > #include <stdio.h>
>
> int main(int argc, char *argv[])
> {
> int m,j,k,g;
> int p,e,i,d;
> for(g=1;;g++)
> {
> scanf("%d%d%d%d",&p,&e,&i,&d);
> if(p==-1&&e==-1&&i==-1&&d==-1)break;
> for(m=924;m>=1;m--)
> for(j=759;j>=1;j--)
> for(k=644;k>=1;k--)
> if((m*23+p)==(j*28+e)&&(j*28+e)==(k*33+i))
> {printf("case %d: the next triple peak occurs in %d days\n",g,(m*23+p-d));goto elf;}
> elf:{};
> }
>
> return 0;
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator