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 |
Wrong Answer,是什么原因?请大家指点下,thanks#include <stdio.h> int main() { int x,y,m,n,l,t,i; scanf("%d %d %d %d %d",&x,&y,&m,&n,&l); fflush(stdin); if(m > n) { m = m - n; x = (x>y?l-x+y:y-x); } else { m = n - m; x = (x<y?l-y+x:x-y); } t = 1; while(1) { i = (m*t)%l; if(i == x) { printf("%d\n", t); break; } else if(i == 0) { printf("Impossible\n"); break; } ++t; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator