yazan_istatiyeh's blog

By yazan_istatiyeh, history, 3 years ago, In English

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:)

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

»
3 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

Nice Problem-set guys. <3

»
3 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Excited for the next rounds,thx for the preparers

»
3 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

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

»
3 years ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

interesting problems and very good tutorial, well done guys.

»
3 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

good collection of problems keep coding!

»
3 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Can you please open the solutions ?

»
3 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

Nice problems set :3

»
3 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Good Problem-set. Waiting for next round

»
3 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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;

»
3 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Nice Problem-set. Waiting for more

»
3 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

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

  • »
    »
    3 years ago, hide # ^ |
    Rev. 3  
    Vote: I like it 0 Vote: I do not like it

    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.