Please, try EDU on Codeforces! New educational section with videos, subtitles, texts, and problems. ×

v-O_O-v's blog

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

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?

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