<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>baitop</author_name>
  <author_url>https://blog.hatena.ne.jp/baitop/</author_url>
  <blog_title>バイトの競プロメモ</blog_title>
  <blog_url>https://baitop.hatenadiary.jp/</blog_url>
  <categories>
    <anon>順列</anon>
    <anon>ARC_パズル</anon>
    <anon>貪欲</anon>
  </categories>
  <description>解けなかったので、こういう流れで解きたかったという妄想を書きます C - K Derangement 分かりやすさのために、以降i=0~N-1で0~N-1の順列を並び替える問題として考えます 解説 問題文で問われているのは辞書順最小なので、先頭からなるべく小さい数を入れていきたいです。 上のグラフは横軸がiの値、縦軸がAiの値で、赤線が理想の配置です i=0~K-1の時は Aiにi+K以上の値しか使えないため、Ai = i+kとするのが理想で i=K~2K-1の時はAiにi-Kも使えるようになるので、Ai = i-Kとするのが理想です i = 2K ~ N-1以上の時は、Aiとして使える値も2…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fbaitop.hatenadiary.jp%2Fentry%2F2022%2F07%2F17%2F183001&quot; title=&quot;AtCoder Regular Contest 144 C - K Derangement - バイトの競プロメモ&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>https://cdn-ak.f.st-hatena.com/images/fotolife/b/baitop/20220717/20220717171354.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-07-17 18:30:01</published>
  <title>AtCoder Regular Contest 144 C - K Derangement</title>
  <type>rich</type>
  <url>https://baitop.hatenadiary.jp/entry/2022/07/17/183001</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
