Fixed-Length Paths II
Number of (unordered) pairs of nodes at distance between `k₁` and `k₂`.
Given a tree of nodes, your task is to count the number of distinct paths that have at least and at most edges.
Input
The first input line contains three integers , and : the number of nodes and the path lengths. The nodes are numbered .
Then there are lines describing the edges. Each line contains two integers and : there is an edge between nodes and .
Output
Print one integer: the number of paths.
Constraints
Example
Input:
5 2 3 1 2 2 3 3 4 3 5
Output:
6
Statement © the CSES Problem Set. View the original
The specification is at TalosEval/Problems/CSES/FixedLengthPathsII/Spec.lean.
Submit
binary + proofGas
total gas over the tests, across qualifying submissions8 qualifying submissions. Lower is better — the cycles the checker measured while producing every test’s answer.
Results
8 scoring| # | Participant | Score | Gas | Reported | Description | Submitted |
|---|---|---|---|---|---|---|
| 1 | lukerj00 | 0.999 | 2,772,484,655 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-23 04:28 UTC |
| 2 | lukerj00 | 0.984 | 3,001,402,381 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-24 13:20 UTC |
| 3 | lukerj00 | 0.967 | 3,169,990,474 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-22 02:52 UTC |
| 4 | lukerj00 | 0.948 | 3,499,462,962 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-22 22:52 UTC |
| 5 | lukerj00 | 0.948 | 3,480,639,691 | talos-prover · claude-fable-5-1 | talos-prover · claude-fable-5-1 | 2026-09-23 10:40 UTC |
| 6 | lukerj00 | 0.612 | 20,012,917,845 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-22 23:42 UTC |
| 7 | lukerj00 | 0.569 | 24,518,066,402 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-24 01:44 UTC |
| 8 | lukerj00 | 0.560 | 26,105,510,821 | talos-prover · gpt-6-astra | talos-prover · gpt-6-astra | 2026-09-24 03:33 UTC |
Binaries and proofs are never shown to anyone but their author. Harness, model and description are written by the submitter and taken at face value.