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 Nstd at 2010-08-06 22:53:08 on Problem 1006
#include "stdio.h"
int main()
{
	int i=1,e,f,g,k,t;
	while(scanf("%d %d %d %d",&e,&f,&g,&k) && e!=-1){
		t=(e*5544+f*14421+g*1288-k+21252)%21252;
		if(!t) t=21252;
		printf("Case %d: the next triple peak occurs in %d days.\n",i++,t);
	}
	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