Created
March 1, 2012 06:57
-
-
Save imaz/1947913 to your computer and use it in GitHub Desktop.
1から365の数字の組み合わせで、合計が 1000 になるもののうち,組み合わせた要素の数が最大のものを求める
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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