Блог пользователя Savior-of-Cross

Автор Savior-of-Cross, история, 4 месяца назад, По-английски

Contest Link

How to solve A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, and Q?

(I'm only curious about N and O, but I might as well ask them all in case others are curious about other problems)

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

»
4 месяца назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

In O: let's assume M_i,i = 1, and a_i = M_i, i+1. then the terms on the kth diagonal are (a_i ... a_i+k) / k!

Knowing this, if we look at a specific prime power p, the condition for M_xy is equivalent to a condition on the total number of times p divides a_x..a_y. We can solve it using negative-weight shortest-path finding in a graph.