<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mayokoex</author_name>
  <author_url>https://blog.hatena.ne.jp/mayokoex/</author_url>
  <blog_title>mayoko’s diary</blog_title>
  <blog_url>https://mayokoex.hatenablog.com/</blog_url>
  <categories>
    <anon>CodeForces</anon>
  </categories>
  <description>問題 codeforces.com 解法 普通に dp しようと考えると, dp[m][n] = (m 個目の花火の時座標 n にいるような場合で, 喜び度の max 値) というのが考えられて, これは dp[m][n] = (dp[m][n-diff], dp[m][n-diff+1], ..., dp[m][n+diff] の最小値) + abs(A[m]-n) と書けます。最小値は区間的になっているので, segment tree で大勝利, かと思ったんですが n*m の時点で結構きついので O(nm log n) だと間に合いません。ということで, O(nm) にすることを考えるん…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmayokoex.hatenablog.com%2Fentry%2F2016%2F02%2F08%2F182047&quot; title=&quot;Codeforces Round #219 (Div. 1) C. Watching Fireworks is Fun - mayoko’s diary&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2016-02-08 18:20:47</published>
  <title>Codeforces Round #219 (Div. 1) C. Watching Fireworks is Fun</title>
  <type>rich</type>
  <url>https://mayokoex.hatenablog.com/entry/2016/02/08/182047</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
