結果
| 問題 | No.170 スワップ文字列(Easy) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-08-22 12:48:46 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 32 ms / 5,000 ms | 
| コード長 | 318 bytes | 
| コンパイル時間 | 213 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-12-23 00:30:46 | 
| 合計ジャッジ時間 | 1,736 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
import itertools
S = input()
dic = dict()
for c in S:
    if c not in dic:
        dic.update({c:1})
    else:
        dic[c] += 1
length = len(S)
res = 1
vs = [i for i in dic.values()]
vs.sort()
vs = vs[::-1]
for i in vs:
    res *= len(list(itertools.combinations(range(length), i)))
    length -= i
print(res-1)
            
            
            
        