Skip to content

Instantly share code, notes, and snippets.

@imaz
Created March 1, 2012 06:57
Show Gist options
  • Save imaz/1947913 to your computer and use it in GitHub Desktop.
Save imaz/1947913 to your computer and use it in GitHub Desktop.
1から365の数字の組み合わせで、合計が 1000 になるもののうち,組み合わせた要素の数が最大のものを求める
https://gist.github.com/1947745
考えている途中メモ
(1+x)*x/2 = y
 ⇒x個が最大
(1+x)*x/2 + a = y
 ⇒a+(1~x又はその組合せ) が x+(1~) になるものを探す
  ⇒(過程する最大値~x)をbと置いて、b-aの結果cがx以下になるところを探してbを抜いてcを入れる
  ⇒他
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment