Hello, RiNSpy, you wrote: RNS> Hello, Kernighan, you wrote: K>> Hello, Sharov, you wrote: S>>> we Sort players by level decrease. Further, we take the first M players (i.e. with the greatest level) and it is assigned them in commands from 1 to M. On . Iterations we take following M of players and it is assigned them in commands already from M to 1. On . Iterations again from 1 to M. I.e. a command on before. Iterations getting the player with the least level, on leaked. Level receives the player with the greatest. K>> and after that conjugate swaps. Whether RNS> it is possible to find necessary conjugate swap for result improving, without search of all possible swaps? I.e. during O (K)? It is possible to consider that players in commands are already sorted by decrease. For the given pair of commands, obviously, it is possible to find the best swap of pair players for O (K ln (K)). However, for it is required search of all pairs commands O ((M/K) ^2 K ln (K)) =O (M^2 ln (K)/K) that is better than O (M^2) (the full search of pairs players), but not on many. For K=10, possibly, it is not necessary to be wrapped. If to begin with pair of commands, for which the probability to find swap is maximum, (the best + the worst commands), and to be restricted first found swap on average time will be even less. Considering that the minimum but only "good enough decision", sometimes a leveling cycle stop if refining swaps are not present among between the best and worst commands more is necessary not.