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

我来贴一个一次AC的 超级简短 的代码

Posted by lmm333 at 2010-07-12 20:28:51 on Problem 1006
#include<stdio.h>
int main(){
    int e,p,i,d,t=0,k;
    while(scanf("%d %d %d %d",&p,&e,&i,&d)&&(p!=-1 ||e!=-1||i!=-1||d!=-1))
    {
		t++;
		for(k=1;k<=21252;k++)
			if((k+d-p)/23*23+p-d==k && (k+d-e)/28*28+e-d==k && (k+d-i)/33*33+i-d==k) break;			
		printf("Case %d: the next triple peak occurs in %d days.\n",t,k);
	}

    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