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

拜托各位师兄师姐,为什么我的世界观就和acm不一样呢?帮帮忙指点一下呗

Posted by missnorthern at 2008-01-04 19:06:21 on Problem 1061
#include <iostream>

using namespace std;

int main()
{
   int x,y,m,n,l,s;
   while(cin>>x>>y>>m>>n>>l)
   {
   if(m>n)
      if(x<y) s=y-x;
      else    s=y-x+l;
   else if (x<y) s=l-y+x;
        else s=x-y;
   if(s%(m-n)!=0||m==n)
      cout<<"Impossible";
   else if(m>n) cout<<s/(m-n);
      else cout<<s/(n-m);
   }
   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