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 xq111 at 2005-07-12 19:35:51 on Problem 1061
我不知道自己的程序为什么总是WA?哪位高人出手指教啊!

#include <iostream.h>
#include <math.h>

void main()
{
	unsigned long int x,y,m,n,L,t;
    cin>>x>>y>>m>>n>>L;
	if(m==n) cout<<"Impossible"<<endl;
	else{
		if(m>n) {
			if(abs(x-y)%(m-n)==0){
				t=abs(x-y)/(m-n);
				cout<<t<<endl;
			}
			else cout<<"Impossible"<<endl;
		}
		else{
			if((L-abs(x-y))%(n-m)==0){
				t=(L-abs(x-y))/(n-m);
				cout<<t<<endl;
			}
			else cout<<"Impossible"<<endl;
		}
		}
}

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