ながめも

競技プログラミングについて

2021-02-19から1日間の記事一覧

Codeforces Round #703 (Div. 2) D - Max Median

codeforces.com 問題 You are a given an array 𝑎 of length 𝑛. Find a subarray 𝑎[𝑙..𝑟] with length at least 𝑘 with the largest median. Then, output the maximum median you can get. 解説 まず「中央値がxにできるか」という判定問題をO(N)で解くこと…