Good evening!
Soon many of you will have your examinations, and someone even have it now. I wish you excellent marks and many easy exams!
Thanks to Nickolay Kuznetsov, Gerald Agapov and Ivan Fefer for their help in preparation of the round.
Good luck!
Artem Rakhov and Codeforces team
UPD:
- Standings
- Problems
- Winner: ghostof2007
eg.Problem C He thinks that it does "not do to arrange" the book.
eg Problem B It was not written whether the numbers are Integer?
if we have some string s1 we try to get shorter s2 by reverse operation described in problem. To avoid repetition we use memoization.
I dont need the code; just the approach would be quite helpful.
(sort of chess coloring)
So we calculate the difference between our target string and our given string. (we choose minimal)
it's easy to see there always exist way of reduction of our string to the target function
easy way to see it:
11101
target string:
10101
we could have chosen first and second as well as second and third
n, 1, 2, ... , n-1
2, 3, ... , n-1, n, 1
Thanks.
1 999
I also got it wrong, finally found that pow function was not giving desired answer.
-------------------My failed test case----
And your program does outout 3 on my system.
This erratic behavior of pow caused me WA. :(
1000101001->1010101001->1010101010 =>2?