The contest is rescheduled to start on 19:45.

Thank you all for participating in Codeforces Beta Round #7. I hope you enjoyed it. You may discuss the problems and system in comments. Please express your opinion, especially if you notice any inappropriate behavior. And as always, I will read with interest the suggestions for improvement.

From today on both-divisions contests ratings will be updated separately for each division. I. e. ratings will be calculated as if two contests (one per division) have taken place on the same problemset.

Also I would like to see someone who wants to write contest tutorial. This must be done in Russian and English languages. Of course you must solve the problem on either contest, or in the practice. If you have a desire to do it - write in comments. Your post will be published on the main page and later available on special link available from the contest page.

Good luck.

Ratings has been updated. Solutions are available for view.

what's different between them ?

problem in SGU : http://acm.sgu.ru/problem.php?contest=0&problem=106

This problem is quite standart application of linear Diophantine equations. :)

is there an available file ( or a way ) to download the problems and print them?

- I entered the practice contest, but am only able to see the solutions of recently submitted people , not all the ones who submitted.

http://codeforces.com/contest/7/status/E?order=BY_ARRIVED_ASC

If Petr took part in the competition, he will 99% sure appear in this list ;)

How to solve problem D?

Assume $$$0$$$-based indexing. Let $$$dp_i$$$ denote the degree of the $$$i$$$-th prefix. The length of the prefix, $$$len = i + 1$$$. Firstly, $$$dp_0 = 1$$$, since a $$$1$$$-length string is a palindrome.

Now, to compute $$$dp_i$$$, firstly check to see if $$$i$$$-th prefix is a palindrome or not. If it is not a palindrome $$$dp_i = 0$$$. Otherwise if the prefix is palindrome, its degree would be = (degree of the first half + 1). So, $$$dp_i = dp_{\lfloor\frac{i-1}{2}\rfloor} + 1$$$.

To check whehter the prefix of length $$$len$$$ is a palindrome, you have to check whether the substring on the first $$$\lfloor{\frac{len}{2}}\rfloor$$$ characters is the same as the reverse of the substring on the last $$$\lfloor{\frac{len}{2}}\rfloor$$$ characters. To compare substrings, you can use string hashing. One ways is to build prefix hashes on the string and its reverse to obtain hash of any substring in a O(1) time as described in this blog.

The answer is simply $$$\sum\limits_{i = 0}^{n-1} dp_i$$$.

Code