<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>moistx</author_name>
  <author_url>https://blog.hatena.ne.jp/moistx/</author_url>
  <blog_title>Logfiles</blog_title>
  <blog_url>https://logfiles.hatenablog.com/</blog_url>
  <categories>
    <anon>SRM</anon>
  </categories>
  <description>解法 いくらかパターンをイメージすると、長いのから順に消費していけば良いことが分かる。 class OlympicCandles { public: int numberOfNights(vector &lt;int&gt; C) { int cnt = -1; for(int i=0; i&lt;C.size()+1; i++) { sort(ALL(C), greater&lt;int&gt;()); for(int j=0; j&lt;i; j++) { if(C[j] &gt; 0) C[j] --; else goto EXIT; } cnt ++; } EXIT:; return cnt; } };</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Flogfiles.hatenablog.com%2Fentry%2F20140818%2F1408325598&quot; title=&quot;SRM408 Div1Easy OlympicCandles - Logfiles&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>2014-08-18 10:33:18</published>
  <title>SRM408 Div1Easy OlympicCandles</title>
  <type>rich</type>
  <url>https://logfiles.hatenablog.com/entry/20140818/1408325598</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
