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 |
Re:一般来说,最好不要用“绝对”两个字In Reply To:一般来说,最好不要用“绝对”两个字 Posted by:xfxyjwf at 2007-10-26 15:50:32 #include <stdio.h> int main(){ __int64 x,y,m,n,L,s,minutes,count,detV,seq; scanf("%I64d %I64d %I64d %I64d %I64d",&x,&y,&m,&n,&L); if(x == y){ printf("0\n"); return 0; } else if(m == n){ printf("Impossible\n"); return 0; } else{ x %= L; y %= L; if(m > n && x > y) s = (y - x)%L; else if(m < n && x < y) s = (x - y)%L; else s = x - y > 0 ? x - y : y - x; detV = m - n > 0 ? m - n : n - m; count = L / detV; L %= detV; minutes = s / detV; seq = (s %= detV); while(s){ s += L; minutes += count; minutes += s / detV; s %= detV; if(s == seq){ printf("Impossible\n"); return 0; } } printf("%I64d\n",minutes); } return 0; } 请告诉我以上这段程序在哪个测试点没有通过行不,因为我与AC的程序基本一模一样,而且您也说过了能AC的程序不一定正确,可是它可以通过的测试点为什么我不能过。 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator