← CSES Better

Bound the Number of Unique Stars

ZIO · 2026 · Zonal Informatics Olympiad · P1

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

intervals · sweep-line · extremal-counting

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

interval coverage

Stars persist across consecutive nights

Each star contributes to a continuous interval of nights; nightly totals constrain but do not uniquely determine the star intervals.

star interval 1
0–3
star interval 2
1–4
night coverage
2–5
  1. 1

    Plot nightly totals

    Plot each observed count as the number of active intervals that night.
  2. 2

    Construct interval models

    Consider interval collections that realize the same coverage while minimizing or maximizing the number of distinct stars.
  3. 3

    Add extreme counts

    Add the two extreme feasible counts.
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.