<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>sugarknri</author_name>
  <author_url>https://blog.hatena.ne.jp/sugarknri/</author_url>
  <blog_title>メモ</blog_title>
  <blog_url>https://sugarknri.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>問題はこちら No.507 ゲーム大会(チーム決め) - yukicoderK君以外の人のスコアを昇順にソートしておく 何点の人と組めばよいかを二分探索で求める。 X点の組がM位タイ以内に入れるというのは、X点より真に大きな点の組がM組未満であることと同値 これは尺取法によりO(N)で求まる。 二分探索が収束するまでO(logN)回やるので全体としてはO(NlogN) a[1&lt;&lt;17];n,M,l,r,m,ll,rr,k; c(int*p,int*q){return*p-*q;} main(){ scanf(&quot;%d%d&quot;,&amp;n,&amp;M); for(int i=0;i&lt;n;i++)scanf(&quot;%…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsugarknri.hatenablog.com%2Fentry%2F2017%2F06%2F15%2F082205&quot; title=&quot;yukicoder No.507 ゲーム大会(チーム決め) - メモ&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>2017-06-15 08:22:05</published>
  <title>yukicoder No.507 ゲーム大会(チーム決め)</title>
  <type>rich</type>
  <url>https://sugarknri.hatenablog.com/entry/2017/06/15/082205</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
