Jugo's blog

By Jugo, 5 days ago, translation,

Editorial in PDF:

329695A - Strange message

Translate author: MatesV13

Solution author: Jugo

tutorial
code

329695B - Bunker code

Translate author: MatesV13

Solution author: Jugo

tutorial
code

329695C - Loss of the number

Translate author: MatesV13

Solution author: Gareton

tutorial
code

329695D - Mysterious pen

Translate author: MatesV13

Solution author: Jugo

tutorial
code

329695E - Under fire again

Translate author: MatesV13

Solution author: Jugo

tutorial
code

329695F - Preparation for the hit

Translate author: MatesV13

Solution author: Gareton

tutorial
code

329695G - Sudden shotdown

Translate author: MatesV13

Solution author: Jugo

tutorial
code

329695H - Implementation of the plan

Translate author: MatesV13

Solution author: Jugo

tutorial
code

329695I - Final battle

Translate author: MatesV13

Solution author: Jugo

tutorial
code

329695J - Afterword

Translate author: MatesV13

Solution author: Jugo, xyz.

tutorial
code

• +14

 » 5 days ago, # |   0 Auto comment: topic has been updated by Jugo (previous revision, new revision, compare).
 » 3 days ago, # |   +4 Can someone please explain to me Problem C solution.I was trying to relate it to a Standard P&C problem of finding the rank of a word in a dictionary like if $a_i$ is $!= i$ then the total possible ways of arranging $n-i$ numbers is $(n-i)!*i$ and for the whole array it will be the summation of this.
•  » » 2 days ago, # ^ | ← Rev. 2 →   0 Okay, I'll try. Imagine that we have counted the number of permutations that are lexicographically smaller than the given one. Then the answer will be cnt + 1. We will process the permutation from left to right. From the definition of a lexicographically smaller permutation, a permutation a is less than a permutation b if the first m numbers of these permutations are the same, and the (m + 1) th number of a permutation a is less than the (m + 1) th number of b permutation. Let's say we are now at position i. Consider all the numbers of this permutation that are to the right of the current position i. Then it follows from the definition above that if we put a number Pj at position i such that Pj < Pi and j > i, this permutation will be lexicographically smaller. Then if we know the number of such Pj's, call it k, this will add k * (n — i)! to the answer, since if Pj < Pi, the arrangement of the remaining (n — i) elements is not important to us. To find k, you can use, for example, a data structure such as the Fenwick tree.
•  » » » 2 days ago, # ^ |   +3 Ok now i understood what was the use of fenwick tree in this question.Thanks for help.
•  » » » » 2 days ago, # ^ |   0 You're welcome :)