回答編集履歴

2

実行結果へのリンクを追加した。

2016/05/06 02:32

投稿

matobaa
matobaa

スコア2493

test CHANGED
@@ -34,6 +34,10 @@
34
34
 
35
35
 
36
36
 
37
+ 実行結果はこちら: [http://ideone.com/Vy52JY](http://ideone.com/Vy52JY)
38
+
39
+
40
+
37
41
  検索中に、こんな記事を見つけました。わけがわからない。
38
42
 
39
43
  [全ての組み合わせを作る](http://www.programming-magic.com/20090123132035/)

1

ワンライナー側にimportが抜けていたので追記した。

2016/05/06 02:32

投稿

matobaa
matobaa

スコア2493

test CHANGED
@@ -1,3 +1,7 @@
1
+ ライブラリありそうだなーと探してみました。
2
+
3
+
4
+
1
5
  ```python
2
6
 
3
7
  from itertools import permutations
@@ -22,12 +26,14 @@
22
26
 
23
27
  ```python
24
28
 
29
+ from itertools import permutations
30
+
25
31
  print sorted(set([sum(x) for x in permutations([1,1,1 ,5,10,10,10,50,100,100,100,500], 3)]))
26
32
 
27
33
  ```
28
34
 
29
35
 
30
36
 
31
- ライブラリありそうだなーと探していたら、こんな記事を見つけました。わけがわからない。
37
+ 検索中に、こんな記事を見つけました。わけがわからない。
32
38
 
33
39
  [全ての組み合わせを作る](http://www.programming-magic.com/20090123132035/)