<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>fgshun</author_name>
  <author_url>https://blog.hatena.ne.jp/fgshun/</author_url>
  <blog_title>銀月の符号</blog_title>
  <blog_url>https://fgshun.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>久しぶりの Python レシピ追加、『112:バイナリサーチを行う』。 bisect 組み込みモジュールを使うだけ。未執筆かつ簡単そうなものを探してみたら、これが見つかったのでリハビリがてら。アルゴリズムの勉強のために一から組みたい人は「Python 二分探索」あたりで検索したり、 bisect.py のコードを読むと吉。 # coding: utf-8 u&quot;&quot;&quot;二分探索を行う &quot;&quot;&quot; from bisect import bisect_left, bisect_right def bsearch_first(seq, value): u&quot;&quot;&quot;最初に見つかった index を返す。見つからな…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffgshun.hatenablog.com%2Fentry%2F20090604%2F1244119224&quot; title=&quot;レシピ追加、バイナリサーチを行う - 銀月の符号&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>2009-06-04 21:40:24</published>
  <title>レシピ追加、バイナリサーチを行う</title>
  <type>rich</type>
  <url>https://fgshun.hatenablog.com/entry/20090604/1244119224</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
