{"blog_url":"https://inamori.hateblo.jp/","image_url":null,"width":"100%","height":"190","provider_name":"Hatena Blog","blog_title":"inamori\u2019s diary","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20100904%2Fp1\" title=\"permutations - inamori\u2019s diary\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","author_name":"inamori","url":"https://inamori.hateblo.jp/entry/20100904/p1","description":"\u9806\u5217\u3092\u6b21\u3005\u306b\u51fa\u3057\u307e\u3059\u3002 \u4f8b\u3048\u3070\u3001[ 1, 2, 3 ]\u3068\u3044\u3046\u30ea\u30b9\u30c8\u304c\u3042\u3063\u305f\u3068\u3057\u30662\u8981\u7d20\u306e\u9806\u5217\u3092\u51fa\u3059\u3068\u3001 [ [ 1, 2 ], [ 1, 3 ], [ 2, 1 ], [ 2, 3 ], [ 3, 1 ], [ 3, 2 ] ]\u3068\u306a\u308a\u307e\u3059\u3002\u3053\u306epermutations\u306fPython\u3067\u306f\u7c21\u5358\u306b\u66f8\u3051\u307e\u3059\uff08\u672c\u5f53\u306f\u30e9\u30a4\u30d6\u30e9\u30ea\u306b\u3042\u308b\u306e\u3067\u3053\u308c\u3092\u66f8\u304f\u5fc5\u8981\u306f\u3042\u308a\u307e\u305b\u3093\uff09\u3002 def permutations(v, n): if n == 0: yield () else: for k in xrange(len(v)): for a in permutations(v[:k] + v[k+1:], n - 1)\u2026","author_url":"https://blog.hatena.ne.jp/inamori/","version":"1.0","categories":["C++"],"provider_url":"https://hatena.blog","published":"2010-09-04 00:00:01","title":"permutations"}