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

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

451364A - Divisor Giveaway

Idea: yazan_istatiyeh, prepared: noomaK

Tutorial
Solution
Rate the problem

451364B - Divisor Game

Idea: DeadPixel99, prepared: noomaK

Tutorial
Solution
Rate the problem

451364C - Burst Error

Idea: noomaK, prepared: noomaK

Tutorial
Solution
Rate the problem

451364D - 80 Bunti

Idea: noomaK, prepared: noomaK

Tutorial
Solution
Rate the problem
Bonus

451364E - JPC Civil War

Idea: noomaK, prepared: yazan_istatiyeh

Tutorial
Solution
Rate the problem

451364F - Minimum Presses

Idea: yazan_istatiyeh & noomaK, prepared: yazan_istatiyeh

Tutorial
Solution - 1
Solution - 2
Alternative solution
Rate the problem

451364G - Avada Kedavra

Idea: noomaK, prepared: noomaK

Hint 1
Hint 2
Hint 3
Tutorial
Solution
Rate the problem

We hope you enjoyed the contest and benefited from it, and would love to hear your feedback:)

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

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

Nice Problem-set guys. <3

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

Excited for the next rounds,thx for the preparers

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

Maximum manhattan distance can be calculated in $$$O(k)$$$ for $$$k$$$ given points in the problem D. My Submission

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

interesting problems and very good tutorial, well done guys.

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

good collection of problems keep coding!

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

Can you please open the solutions ?

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

Nice problems set :3

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

Good Problem-set. Waiting for next round

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

In F. The solution by noomaK. I don't understand why we're multiplying by 4 instead of 2 in the step:

ans -= d * 4ll * sum;

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

not able to understand F editorial can anyone explain better how to find lcp over all pairs using trie

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

    Let's imagine the trie as graph, for any two string their lcp node is the lca of the two nodes that represents their final character.

    Knowing that, now we need to count for every node in the trie how many pairs this node is the lca.

    For a node $$$u$$$ to be the lca of two nodes $$$a$$$ and $$$b$$$, $$$a$$$ and $$$b$$$ should be in the subtree of $$$u$$$ and $$$a$$$ should be in a subtree of a different child of $$$u$$$ than $$$b$$$.

    To count the number of pairs for each node, we can traverse the children of $$$u$$$ in any order and keep the count of terminal nodes we've seen so far in other subtrees other than this child, and add the contribution from this child with other visited children.