<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>komiyam</author_name>
  <author_url>https://blog.hatena.ne.jp/komiyam/</author_url>
  <blog_title>komiyamの日記</blog_title>
  <blog_url>https://komiyam.hatenadiary.org/</blog_url>
  <categories>
    <anon>PKU</anon>
    <anon>UVa</anon>
    <anon>SPOJ</anon>
    <anon>蟻本</anon>
  </categories>
  <description>keyword RMQ C++ 問題概要 長さN(区間で最頻値が何度表れるかというQ( 解法 まず、数列が単調なので連続する同じ数を調べる。例えば、{-1,-1,1,1,1,1,3,10,10,10}は新しい数列x={2,4,1,3} に変換する。そしてxの累積和も持っておく。クエリp,qに対して、p,qに完全に含まれる区間(これを累積和で求める)の最大値はRMQで求める。後は端と比較してやればよい(この処理が一番引っかかった)。引っかかってたテストケースは{0,1,1,1,1,2,3}に対するクエリ3,4とか(答えは2)。 計算量はO((N+Q)*log N)。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkomiyam.hatenadiary.org%2Fentry%2F20110319%2F1300492097&quot; title=&quot;POJ-3368, SPOJ-FREQUENT, UVa-11235, TJU-2913: Frequent values - komiyamの日記&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>2011-03-19 08:48:17</published>
  <title>POJ-3368, SPOJ-FREQUENT, UVa-11235, TJU-2913: Frequent values</title>
  <type>rich</type>
  <url>https://komiyam.hatenadiary.org/entry/20110319/1300492097</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
