← CSES Better

Meeting Time

USACO · 2015 · January · silver-3

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

graph-algorithms · dynamic-programming

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

sample trace

Meeting Time: reachable-time states

For each vertex, keep the durations that can reach it; propagate those states along outgoing edges, then find the smallest duration present for both cows at the destination.

  1. 1

    State

    For each vertex and time, record whether a path can reach that vertex in exactly that time.
  2. 2

    Transition

    For an edge, add that cow?s edge duration and mark the resulting time at the next vertex.
  3. 3

    Intersect

    At field 3, compare the two reachable-time sets; the first shared duration is 2.
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.