Hosen_ba's blog

By Hosen_ba, history, 15 months ago, In English

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.

  • Vote: I like it
  • +11
  • Vote: I do not like it

| Write comment?
»
15 months ago, # |
  Vote: I like it 0 Vote: I do not like it

How to find Product of Divisors in this CSES Problem

  • »
    »
    15 months ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    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)