<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>zehnpaard</author_name>
  <author_url>https://blog.hatena.ne.jp/zehnpaard/</author_url>
  <blog_title>Arantium Maestum</blog_title>
  <blog_url>https://zehnpaard.hatenablog.com/</blog_url>
  <categories>
    <anon>Python</anon>
    <anon>蟻本</anon>
  </categories>
  <description>POJ/蟻本から： 3617 -- Best Cow Line ある文字列の左右どちらかの端から文字を1個ずつ取って、lexical orderが最小になる文字列を作成する、という問題。 最初は舐めていたのだが、bacbなどを正しく処理するためには先読みが必要になる。 しかしbbbbbacbbbbbやabcabcabcdecbacbacbaなど、ナイーブに先読みすると簡単にO(N^2)になってしまう。個別には対処できるのだが、すべてのケースを網羅してO(N^2)を避けるうまい書き方が思い浮かばず、思わず蟻本の回答を見たら何事もなくO(N^2)だった。でもN&lt;2000だから1000msで4*10…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fzehnpaard.hatenablog.com%2Fentry%2F2018%2F03%2F11%2F104548&quot; title=&quot;Best Cow Line問題 - Arantium Maestum&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>2018-03-11 10:45:48</published>
  <title>Best Cow Line問題</title>
  <type>rich</type>
  <url>https://zehnpaard.hatenablog.com/entry/2018/03/11/104548</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
