Блог пользователя v-O_O-v

Автор v-O_O-v, история, 5 лет назад, По-английски

I have solved 285C - Building Permutation 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?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится