Codeforces will not be available in the period 01:00-05:00 May, 30 (MSK, UTC +3) because of maintenance. ×

v-O_O-v's blog

By v-O_O-v, history, 8 months ago, In English,

I have solved 285C - Получаем перестановку using a greedy approach i.e sort all the values and then count the number of moves to make first element 1, the next to 2 and so on... But how can we come to the conclusion that this is always optimal and produces the minimum number of moves?

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it