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 |
Time Limit Exceededvoid _1061(int xx,int yy,int mm,int nn,int ll); int main(void) { int x,y,m,n,l; scanf("%d %d %d %d %d",&x,&y,&m,&n,&l); _1061(x,y,m,n,l); return 0; } void _1061(int xx,int yy,int mm,int nn,int ll) { int k=1,i=xx-yy,j=mm-nn; if(abs(j)==0||abs(j)>=ll&&abs(j)%ll==0) printf("Impossible\n"); else { while(abs(i+j*k)!=0&&(abs(i+j*k)<ll||abs(i+j*k)%ll!=0)) { k++; } printf("%d\n",k); } } 。。。。怎么会这样。。 还有,类型开到long long该怎么办 Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator