← CSES Better

Cultural Programme

INOI · 2008 · Indian National Olympiad in Informatics · INOI0801

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 · overlap-count

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

audience overlap

Find the largest audience from entry and exit intervals

Each entry and exit pair is one audience interval; the largest overlap is the maximum audience. Interval endpoints in the diagram are schematic, not task input values.

audience entry/exit 1
0–3
audience entry/exit 2
1–4
audience entry/exit 3
2–5
  1. 1

    Represent each record

    An entry time and exit time define one person?s interval in the hall.
  2. 2

    Track overlap over time

    At each distinct event time, update the number of people inside.
  3. 3

    Take the maximum

    Return the greatest audience count reached during the programme.
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.