問題一覧 > 通常問題

No.3513 Greedy Yokan Party

レベル : / AI推定難易度 : 1550 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 1024 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 52
作問者 : yt142857 / テスター : aa36 yu23578 Yoyoyo8128 GaLLium Germanium32
お気に入りにしたユーザー ProblemId : 13250 / 自分の提出
問題文最終更新日: 2026-04-24 21:45:17
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 497 聖光学院プログラミングコンテスト2026 day1 (順位表) の他の問題:

Problem Statement

There is a piece of yokan with a left-to-right length of $L$ [cm].
The yokan has $N$ notches, and the $i$-th notch from the left is located $A_i$ [cm] from the left end.

Sei and Hikaru play a game using this yokan. The game proceeds as follows.
1. Hikaru chooses $K$ of the $N$ notches and divides the yokan into $K + 1$ pieces.
2. Sei chooses any one of the $K + 1$ pieces of yokan.
3. Hikaru chooses any one of the remaining $K$ pieces of yokan. Let $H$ be the size of the piece chosen here.

Hikaru acts to maximize $H$, and Sei acts to minimize $H$.
Find the value of $H$ when both players act optimally.

Constraints

  • $1 \leq K \leq N \leq 2 \times 10^5$
  • $1 \leq A_1 < A_2 < A_3 < \cdots < A_N < L \leq 10^9$
  • All inputs are integers.

Input

$N$ $L$
$K$
$A_1$ $A_2$ $A_3$ $\cdots$ $A_N$

Sample

Sample 1
Input
3 10
2
5 6 9
Output
4

Cutting at 5[cm] and 6[cm] from the left is optimal.
Cutting at 5[cm] and 9[cm] from the left is also optimal.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。