| ||||||||||
| 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 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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator