|
|
back to boardPlease tell me how to prove! Posted by PSV 23 Oct 2006 23:14 I've AC but I can't undestand how prove that GCD gives right answer? Re: Please tell me how to prove! Posted by PSV 26 Oct 2006 21:12 Come ON! Please I want to know Re: Please tell me how to prove! Every stone may go to positions pos+K*x, pos - its original place, x - some integer, K - sought value. If for every stone its designated position is reachable (i.e. K divides abs(dst-src)), then stones are sortable - just bubble-sort each of K chains, and they are not sortable otherwise. So, the answer is GCD(dst-src) for all stones. Edited by author 06.08.2008 16:12 |
|
|