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

Re:中国剩余定理居然也能wa?

Posted by dalang at 2010-03-21 20:19:56 on Problem 1006
In Reply To:中国剩余定理居然也能wa? Posted by:bigeyex at 2010-03-15 18:47:42
ans = 21252;
> 常数也没错,坛子里的测试数据也都能过……
> 
> #include<iostream>
> using namespace std;
> 
> int main(){
>     long a,b,c,d,ans,i;
>     i=1;
>     while(1){
>         cin >> a >> b >> c >> d;
>         if(a == -1)break;
>         ans=(5544*a+14421*b+1288*c-d+21252)%21252;
>         if(ans == 0)ans=21512;
>         cout << "Case "<< i <<": the next triple peak occurs in " << ans << " days." << endl;
>         i++;
>     }
>     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