Блог пользователя drexdelta

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

Hello everyone,

I was trying to solve 451 D question. and which turn out to be an easy question due to given constrain of distinct times for each alarm clocks (Please refer to question if you don't understand).

Now I had doubt. What if there could be repetitive values for alarm clocks timings. is it possible to solve this problem with greedy approach ?

If Yes/no , can you please provide proof method.

Thank you (GL & HF)

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

»
7 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I think yes, we can change your problem into orginal problem, with just one modify, that is integer time will change to real time, and you can imagine one point of time which has many clock turn on like many clock turn on at different time but have very small distance between them.

»
7 лет назад, # |
Rev. 2   Проголосовать: нравится +3 Проголосовать: не нравится

Here is my solution for the problem 33847285. The idea will work even if the times are not distinct. Because you are always deleting numbers from the back of the active list of points. Which ends up giving us more better chances in the future.