Practice · 1 of 6
Budget: subsets of 22
CHALLENGE
Difficulty: advanced+25 XP
**Tình huống.** n ≤ 22 items, weights up to 10^12. Count subsets whose weight sum is in [L, R]. Time limit: standard. **Thuật toán nào phù hợp nhất? Chương trình chỉ cần in ra chữ cái.** **A)** Sort + sweep two pointers over items **B)** Enumerate all 2^22 subsets directly and count **C)** Meet in the middle: enumerate halves, sort one, binary search **D)** Segment tree over weights
Press Submit to check your solution.
Back to lesson: Practice: Budget Drill Set