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 wuxiangyu at 2011-12-27 23:29:02 on Problem 1006
#include <iostream>
using namespace std;
int p, e, i, d, t, n=0;
int main()
{
    while (cin>>p>>e>>i>>d, p!=-1){
        for (n++,t=d+1; t<=d+21252; t++)
            if ((t-p)%23==0 && (t-e)%28==0 && (t-i)%33==0) break;
        printf("Case %d: the next triple peak occurs in %d days.\n", n, t-d);
    }
    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