Блог пользователя kittyK

Автор kittyK, история, 6 лет назад, По-английски

For 768C - Jon Snow and his Favourite Number , what is the intuition to solve it ? At first for small constraint I made brute force solution and noticed that there is a pattern , there can be two different arrays — when k is even and when k is odd.

But this is not working . Here is my code .

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

»
6 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

There is a pattern, the arrays repeat themselves after some amount of iterations. Those iterations are not dependent on k though.