<?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>yukicoder</anon>
    <anon>全探索</anon>
  </categories>
  <description>問題 問題概要 条件を満たす最長の文字列の長さを求める問題。 解法 白のブロックをいじることはないので、赤と青のブロックさえいじればいい。ブロックのいじりかたも、そのブロックを使用するか、しないかだけであり、いじらなければならないブロックの総数も20しかないので、これをbitを利用して全探索すればいいことがわかる。 実装は、220通りだけの文字列を生成して、それらのなかで、条件を満たす最大の文字列を探した。 ミス if(p == 19){//sの末尾に'W'がある場合のため for (int k = i + 1; k &lt; 30; ++k){ a[mask] += 'W'; } } 上の部分を書…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmmxsrup.hatenablog.com%2Fentry%2F2016%2F09%2F16%2F030439&quot; title=&quot;yukicoder No.38 赤青白ブロック - 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-09-16 03:04:39</published>
  <title>yukicoder No.38 赤青白ブロック</title>
  <type>rich</type>
  <url>https://mmxsrup.hatenablog.com/entry/2016/09/16/030439</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
