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:是否triple peak可能出现在三个给出日期之前?

Posted by ale at 2004-04-04 20:49:01 on Problem 1006
In Reply To:是否triple peak可能出现在三个给出日期之前? Posted by:C0400104048 at 2004-04-04 18:03:41
恩 我改了一下 你看看

#include <iostream>
#include <vector>
using namespace std;

int main()
{
   vector<int> days;
   int a, b, c, d, x, y, i = 0;
   while(++i){//!start from 1 ,and at last will add another 1 to i
      cin >> a >> b >> c >> d;
      if(a > 365 || a < 0 ||
         b > 365 || b < 0 ||
         c > 365 || c < 0 ||
         d > 365 || d < 0 )
         break;
      x = 0;
      y = 0;
      while(((23 * x - b + a) % 28))
         ++x;
      while(((23 * 28 * y + 23 * x - c + a) % 33))
         ++y;  
      if((23 * 28 * y + 23 * x - d + a) > 0)
          days.push_back(23 * 28 * y + 23 * x - d + a);
          else
             days.push_back(23 * 28 * y + 23 * x - d + a + 21252);
   }
   for(int j = 0; j < i - 1; j++)
      cout << "Case " << j + 1 << ": the next triple peak occurs in "
           << days[j] << " days." << endl;
}


还是wrong answer

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