atcoder beginner contest 172 #c — Tsundoku
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 »
why is my greedy choice wrong? CSES 1084 — Apartments
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?
CodeChef Starters 131 Solution Discussion