← CSES Better

IOI Training Camp 20xx

INOI · 2011 · Indian National Olympiad in Informatics · INOI1102

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

arrays · dynamic-programming · maximum-subarray

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

segment with drops

Maximize a contiguous test segment with up to K drops

Choose one contiguous segment of test marks and discard at most K entries inside it; maximize the sum of the remaining marks.

State table
SegmentDropped testsScore
[l,r]at most Ksum of retained marks
all segmentschoose bestmaximum segment score
  1. 1

    Choose a segment

    The retained tests come from one contiguous range of the original sequence.
  2. 2

    Drop at most K marks

    Within that range, discard up to K test marks before summing.
  3. 3

    Maximize the score

    Find the segment and drops producing the largest retained total.
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.