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

怎么会 有time limit?谢谢帮忙

Posted by lxc0601 at 2007-05-30 12:25:02 on Problem 1061
#include<iostream>
using namespace std;
int main(){
int m;
int n;
int L;
int x;
int y;
int t=1;
int i=1;
  while(cin>>x>>y>>m>>n>>L){}
  if(m==n){cout<<"Impossible"<<endl;}
    else {
               while((x+m*t)%L!=(y+n*t)%L){
                                  i++;t++;}
         }
        cout<<i<<endl;
          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