1st Hunger Games Large Editorial — Community solutions This is the second part of Hunger Games Editorial, hope you'll enjoy it :)
And again, thanks for stuff for awesome contest, congratz for survivors too!
**UPD**: Problems B, D, E, Q, T, W are now available, more soon :)
**Editorial Hall of Fame:**
[user:Stonefeang,2015-08-26]
[user:Andres_Unt,2015-08-26]
[user:cuber2460,2015-08-26]
[user:Anonym_KALEP,2015-08-26]
[user:adamant,2015-08-26]
[user:ngoisao_93,2015-08-27]
[user:gendelpiekel,2015-08-27]
[user:fcdkbear,2015-08-27]
[user:izrak,2015-08-27]
**Problem A: Good Numbers.**
Tutorial by: [user:ngoisao_93,2015-08-28]
Call `LCM(i, j)` the lowest common multiple of i and j.
First, we should analyse that if x is divisible by `LCM(p^i, q^j)`, then x is divisible by `p^i` and `q^j` at the same time.
Call set `s(i, j)` the set of number x in range [l, r] that x is divisible by `LCM(p^i, q^j)`. Call `|s(i, j)|` the size of s(i, j).
We can find out that:
`|s(i, j)| = |s(1, j)| - |s(1, i-1)| = r/LCM(p^i, q^j...
1st Hunger Games Large Editorial — Community solutions, . answer of this query is needed information for this Guni!($g_i$) so we add
thisnumber to second, $, where $L$ is number of values, which X contain. (L can be computed the same
time we write DP, Call set `d(i, j)` the set of number x in range [l, r] that x is divisible by
`LCM(p^i, q^j)` and, Call set `s(i, j)` the set of number x in range [l, r] that x is divisible by
`LCM(p^i, q^j)`. Call, Now we can solve the problem with $DP$ Where $DP[E][S]$=number of ways we can
weight tree with sum, The overall complexity is O($n * log(n) * M$), where $M$ is a number of prime
powers that are less, We consider a number to be the sum of some powers of two. ($X = 2^i + 2^j + 2^k
+ ... $)., Where g[i][j][k] = the number of subsequences with bits i, j and k set. We can
use the Mobius DP, number. After that we'll have an information in the following form: if the left
border of the segment is
Полный текст и комментарии »