|
|
Show all threads Hide all threads Show all messages Hide all messages | any hints? | d3m0n1c | 1862. Very Wealthy Mole | 19 Oct 2012 23:15 | 8 | At least you should be able to write bruteforce in O(n^2 * 2^n) :) For a pair of numbers the number of actions is equal to <length of the first number> + <length of the second number> - 2*<length of the longest common prefix> (numbers are treated as binary strings) Bo`ladigan gap gapirgin-e!!! Your must understand hint of 'aropan'. And get answer = 2^L*(L - 3*2^L + L*2^L + 3) P.S.: Mathcad can help you to find sum of such expression as FOR(z=0,..l)z*2^z. It's only math problem. P.P.S.: To find 2^L use http://en.wikipedia.org/wiki/Exponentiation_by_squaring Edited by author 22.05.2012 22:17 | WA32 | Dmitriy | 1862. Very Wealthy Mole | 29 Oct 2011 22:16 | 4 | WA32 Dmitriy 16 Oct 2011 17:12 что за тест? Edited by author 16.10.2011 17:12 Edited by author 16.10.2011 17:12 Re: WA32 Vedernikoff 'Goryinyich' Sergey (HSE: АОП) 16 Oct 2011 19:46 Check your formulas for overflows а у меня ва31... Dmitriy, разобрались что не так? Разобрался... я магическим образом степень тоже по модулю 10^9+7 брал) Edited by author 31.10.2011 12:42 |
|
|
|