<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>mmxsrup</author_name>
  <author_url>https://blog.hatena.ne.jp/mmxsrup/</author_url>
  <blog_title>srupのメモ帳</blog_title>
  <blog_url>https://mmxsrup.hatenablog.com/</blog_url>
  <categories>
    <anon>arc</anon>
    <anon>セグメント木</anon>
    <anon>二分探索</anon>
  </categories>
  <description>問題 問題概要 タイプ 1 ： S に数 X を追加する。 タイプ 2 ： S に含まれる数のうち X 番目に小さい数を答え、その数を S から削除する。 この２つを高速に行うことができるデータ構造を使えばよい。 解法 今回の問題は、Xがあまり大きくない。よって、バケットソートの要領でsegtreeを使った。seg[k + size - 1]に、X=kがいくつあるかを格納していくことにする。タイプ1の場合、seg[k + size - 1]をインクリメントして、上のノードに対してもそれを反映させながら、区間の和を更新していけばよい。タイプ2の場合、二分探索を使用して求める。x番目に小さい数とい…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmmxsrup.hatenablog.com%2Fentry%2F2016%2F12%2F18%2F143135&quot; title=&quot;ARC 033 C - データ構造 - srupのメモ帳&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-12-18 14:31:35</published>
  <title>ARC 033 C - データ構造</title>
  <type>rich</type>
  <url>https://mmxsrup.hatenablog.com/entry/2016/12/18/143135</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
