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

Автор Hosen_ba, история, 14 месяцев назад, По-английски

Has anyone solved any of these two problems using Dominator Tree?

https://cses.fi/problemset/task/1703

https://cses.fi/problemset/task/1203

Unfortunately my code is failing on a couple tests.

I'd really appreciate it if anyone provides an accepted code using Dominator Tree.

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

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

How to find Product of Divisors in this CSES Problem

  • »
    »
    14 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    for each divisor i there exist a divisor n/i such that i*(n/i)=n,so we can put the divisors into pairs of the form (i,n/i) and the product of each pair is equal to n,so the answer is (n power s/2) where s is the number of divisors,there is a case where n is perfect square then the number of divisors is odd so we just multiply the answer by sqrt(n)