Here are the official tutorial:
A2. Medium
Let us first find a method to check whether a shift by a fixed number kkk yields a solution or not. For the sake of simplicity let us work with the case of n=12n = 12n=12, let also k=3k = 3k=3. We can start by writing a set of equations
(all modulo 222)
(1)(1)(1)
{
x0+x3=y0x3+x6=y3x6+x9=y6x9+x0=y9\begin{cases} x_0 + x_3 = y_0\\ x_3 + x_6 = y_3\\ x_6 + x_9 = y_6\\ x_9 + x_0 = y_9\\ \end{cases}⎩⎪⎪⎪⎨⎪⎪⎪⎧x0+x3=y0x3+x6=y3x6+x9=y6x9+x0=
Codeforces1184A2-Heidi Learns Hashing (Medium)
最新推荐文章于 2020-08-20 08:06:40 发布