| ||||||||||
| 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 | |||||||||
这个程序为何通不过?谁可以帮我举个反例#include <stdio.h>
void main()
{
unsigned long x,y,m,n,l,i,t;
scanf("%u%u%u%u%u",&x,&y,&m,&n,&l);
for(i=1;i<=l;i++)
{
x%=l;
y%=l;
t=m*i%l-n*i%l;
if(t<0)
t+=l;
if(t==((y>x)?y-x:x-y))
{
printf("%d",i);
return;
}
}
printf("Impossible");
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator