I used a greedy approach with priotity queue by first matching boxes to eligible friends who have the highest cost, and then spending the remaining cash on the lowest cost friends left which maximizes the count.
Submission (Rust 2024): https://codeforces.com/contest/2182/submission/355740776
I used a greedy approach with priotity queue by first matching boxes to eligible friends who have the highest cost, and then spending the remaining cash on the lowest cost friends left which maximizes the count.
Submission (Rust 2024): https://codeforces.com/contest/2182/submission/355740776