Doubt on Rebus problem

Правка en1, от parth015, 2016-09-22 19:55:49

I was solving Rebus problem on codeforceslink. I saw the editorial and greedy approach was mentioned in it. It says that we have to greedily choose number for question-mark and then proceed further and check condition. If that condition is not satisfied for all numbers between 1 and n we say that it is not possible.But I have doubt that how can we say that the number we chosen previously by greedy approach does not affect this condition. Means if we have chosen different previous number than the condition can be satisfied. Can anyone prove that greedy approach is true?

Теги greedy

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский parth015 2016-09-22 19:55:49 645 Initial revision (published)