-
Notifications
You must be signed in to change notification settings - Fork 2
inflation
bradendubois edited this page Nov 8, 2021
·
7 revisions
ID: inflation
Difficulty: 1.8
CPU Time: 2 seconds
Memory: 1024 MB
For this, read in all the canisters and sort them in ascending size. Then, any canister in index i corresponds to a balloon of size i+1. If the canister is larger than i+1, the balloon would explode. Otherwise, check what fraction the balloon would be filled, and store the lowest fraction seen while iterating through.