Thank you for participating in our contest! We hope you enjoyed it. Implementations will be added soon.
1983A - Делимость массива
Idea: BlazingDragon
Preparation: Pew_Pew.
1983B - Поворот угла
Idea: Swap-nil
Preparation: Swap-nil
HintHint 1$$$1 + 2 \equiv 0 \pmod{3}$$$.
Hint 2Can you notice something that does not change, an invariant?
1983C - Трое в лодке, не считая торт
Idea: DC17
Preparation: Swap-nil
1983D - Дилемма обмена
Idea: MrSavageVS
Preparation: MrSavageVS
HintHint 1Can we convert this complicated operation to something simpler?
Hint 2We can convert the operation to basically swapping adjacent elements and it still works. Try to prove why?
Hint 3Swapping adjacent elements in a distinct array is basically trying to equate two permutations using adjacent swaps. When is it possible?
Hint 4Inversions in a permutation
1983E - Я люблю шары
Idea: DC17
Preparation: BlazingDragon
1983F - Значения массивов
Idea: TimeWarp101
Preparation: MrSavageVS
HintHint 1Can we fix an upper bound to count the number of subarrays having xor-pair less than that?
Hint 2We can use binary search to fix an upper bound and calculate all subarrays with xor-pair less than the given value.
Hint 3In order to count the number of subarrays we can use a popular data-structure used for a lot of xor-operations.
Hint 4We can binary search on the upper bound and use tries to count the number of subarrays with xor-pair less than given value. This way we can find the kth-smallest value.
1983G - Ваша потеря
Idea: AwakeAnay,TimeWarp101
Preparation: ShivanshJ, Swap-nil, Pew_Pew.
HintsHint 1Try looking at the problem bit by bit.
Hint 2What does the contribution of a particular bit over a path look like?
Hint 3Can you think of some simpler queries you can easily solve the problem for?
Hint 5For a query from a node $$$u$$$ to its ancestor $$$v$$$, the countribution from the counting term $$$(0,1,2,3, \ldots)$$$ changes for the first time at an ancestor at a jump of a power of two.
Hint 6Let $$$dp[u][k]$$$ be the contribution of bit $$$k$$$ to the query from $$$u$$$ to the root.
Hint 7Keep track of a few additional nodes for each query. Read hint 5 again.