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> #include<iostream> using namespace std; int main() { unsigned long x,y,m,n,L; scanf("%d%d%d%d%d",&x,&y,&m,&n,&L); unsigned long s; for(s=1;s<2000000000;s++) { x=(x+m)%L; y=(y+n)%L; if(x==y) { printf("%d\n",s); exit(1); } } printf("Impossible\n"); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator