Ask AI
Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.
Open Claude Desktopdynamic-programming · sets · counting
The organizer’s problem statement is available at the official source link.
score state
Each problem adds one of three score changes
A correct answer adds X, an incorrect answer subtracts one, and skipping adds zero; equal final scores count once.
ss-1 | s | s+Xdeduplicate reachable totals
- 1
Start at zero
Start with reachable score set {0}. - 2
Extend score choices
For each problem, extend every score by −1, 0, or X. - 3
Deduplicate totals
Deduplicate totals and count the distinct reachable scores.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 charsRun output
Run your code to see output.