| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
你连测试数据都过不去,再好好考虑一下。是一个追击问题。In Reply To:我是菜鸟,拜托各位达人拿鸟看看我的程序错在哪儿了…… Posted by:stope234 at 2005-10-01 15:53:50 > #include "stdafx.h"
>
>
> void main()
> {
> long x,y,m,n,l;
> cin>>x>>y>>m>>n>>l;
> int a,e,f,d=1;
> if(m>n)
> {
> if(x<y)
> a=y-x;
> else a=l+x-y;
> }
> else
> {
> if(x<y)
> a=l+x-y;
> else a=y-x;
> }
> int c,b=1;
> while(b<=x)
> {
> if(x/b==int(x/b))
> {
> if(y/b==int(y/b))
> c=b;
> }
> else
> {
> }
> b++;
> }
> if(a/c==int(a/c))
> {
> while((e-f)/l!=int((e-f)/l))
> {
> e=m*d;f=y-x+n*d;
> d++;
> }
> cout<<"需跳"<<d<<"步";
> }
> else
> {
> cout<<"impossible";
> }
> }
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator