回答編集履歴
2
実行結果へのリンクを追加した。
answer
CHANGED
@@ -16,5 +16,7 @@
|
|
16
16
|
print sorted(set([sum(x) for x in permutations([1,1,1 ,5,10,10,10,50,100,100,100,500], 3)]))
|
17
17
|
```
|
18
18
|
|
19
|
+
実行結果はこちら: [http://ideone.com/Vy52JY](http://ideone.com/Vy52JY)
|
20
|
+
|
19
21
|
検索中に、こんな記事を見つけました。わけがわからない。
|
20
22
|
[全ての組み合わせを作る](http://www.programming-magic.com/20090123132035/)
|
1
ワンライナー側にimportが抜けていたので追記した。
answer
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
ライブラリありそうだなーと探してみました。
|
2
|
+
|
1
3
|
```python
|
2
4
|
from itertools import permutations
|
3
5
|
|
@@ -10,8 +12,9 @@
|
|
10
12
|
```
|
11
13
|
|
12
14
|
```python
|
15
|
+
from itertools import permutations
|
13
16
|
print sorted(set([sum(x) for x in permutations([1,1,1 ,5,10,10,10,50,100,100,100,500], 3)]))
|
14
17
|
```
|
15
18
|
|
16
|
-
|
19
|
+
検索中に、こんな記事を見つけました。わけがわからない。
|
17
20
|
[全ての組み合わせを作る](http://www.programming-magic.com/20090123132035/)
|