|
|
I wrote suffix automaton, and with it's help i found solution in 5 lines. Hello!How are you?You are very clever!Help me,please))My problem is "Runtime error" It's unbelieveable, how couldn't I solve it during the contest. Just brute-force for finding answers for smalls n... Hmm no, not so easy, if you do it with pen and paper, it's too easy to overlook the palindromes. You need the results for N<40 before the generic solution becomes obvious. Hello!How are you?You are very clever!Help me,please)I'm confused.My problem is "Runtime error" Hello!How are you?You are very clever!Help me,please)I'm confused.My problem is "Runtime error" Hello) I can't understand how to work with n = 2^1 000 000, cause it's very big number. I think, this problem can be solved at stage of converting entered number, but don't know exactly how) I understood. The right way is not at converting entered binary number to decimal. Edited by author 21.03.2010 20:34 Edited by author 26.08.2011 14:16 how they got 11011100101 from 101? they "Write the integers from 1 to 101 in binary notation successively from left to right" i.e 1 10 11 100 101 thanks,understand :)) but i see that such given string will be very anormous when n is also big.. how this problem can be solved? i have no idea :( for such a big n_s :(( |
|
|