obocheton's blog

By obocheton, history, 4 years ago, In English

getting wrong answer in abc172c — Tsundoku.

my logic is that taking topmost book from two stack which has less required time to read. I greedily repeated this step untill both list are empty or time slot is available.

why my approach is wrong?

Full text and comments »

  • Vote: I like it
  • +9
  • Vote: I do not like it

By obocheton, history, 4 years ago, In English

I was trying this problem CSES 1084.

I greedily choose the lowest sized valid apartment for every applicant (sorted both lists ascendingly).

But it turns out to be a wrong approach.

Why my approach is wrong?

Full text and comments »

  • Vote: I like it
  • +2
  • Vote: I do not like it