結果

問題 No.170 スワップ文字列(Easy)
ユーザー ssmkzk
提出日時 2018-09-18 16:07:33
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 329 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-18 07:59:46
合計ジャッジ時間 1,726 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
S = input()
l = list(S)
ld = []
l.sort()
print(l)
ck = l[0]
count = 0
for l_i in l:
    if ck == l_i:
        count += 1
    else:
        ld.append(count)
        count = 1
    ck = l_i

ld.append(count)

mom = 1
for l_i in ld:
    mom *= math.factorial(l_i)

ans = math.factorial(len(l)) // mom
    
print(ans - 1)
0