← CSES Better

Moovie Mooving

USACO · 2015 · January · gold-2

Open official problem ↗
Ask AI

Open a hint-first prompt in a new AI chat. Grok may ask you to confirm before sending.

Open Claude Desktop

dynamic-programming · binary-search

The organizer’s problem statement is available at the official source link.

sample trace

Moovie Mooving: dynamic programming walkthrough

Moovie Mooving: use the linked editorial?s dynamic programming, binary search idea on the published sample, then verify the displayed output.

Published input4 100 50 3 15 30 55 40 2 0 65 30 2 20 90 20 1 0modelAlgorithm ideaTrack smaller states that summarize partial solutions. For each state, combine the legal predecessor states; the full-task state gives the result.task resultExpected output3 SOLUTION NOTES: Bessie should attend the first showing of the fourth movie from time 0 to time 20. Then she watches the first showing of the first movie from time 20 to time 65. Finally she watches the last showing of the second movie from time 65 to time 100.
  1. 1

    State

    Choose a compact value for each partial subproblem so later choices need only that summary.
  2. 2

    Transition

    Combine legal smaller states to compute reachability, a count, or an optimum for the next state.
  3. 3

    Finish

    Read the state representing the full task and compare it with the published sample output.
  4. 4

    Verify the sample

    Use the published sample output to check the result of this idea on the displayed input.
Tools
1
2
3
4
5
6
7
8
9
10
11
12
Draft saved locally
|12 lines, 156 chars

Run output

Run your code to see output.