結果

問題 No.171 スワップ文字列(Med)
ユーザー roiti46roiti46
提出日時 2015-03-22 23:28:36
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 1,000 ms
コード長 238 bytes
コンパイル時間 70 ms
コンパイル使用メモリ 6,692 KB
実行使用メモリ 6,096 KB
最終ジャッジ日時 2023-09-11 09:31:51
合計ジャッジ時間 1,065 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
5,980 KB
testcase_01 AC 11 ms
5,896 KB
testcase_02 AC 11 ms
6,044 KB
testcase_03 AC 11 ms
5,928 KB
testcase_04 AC 11 ms
5,992 KB
testcase_05 AC 11 ms
5,928 KB
testcase_06 AC 12 ms
5,940 KB
testcase_07 AC 12 ms
6,032 KB
testcase_08 AC 12 ms
6,004 KB
testcase_09 AC 12 ms
5,904 KB
testcase_10 AC 10 ms
5,860 KB
testcase_11 AC 11 ms
6,096 KB
testcase_12 AC 11 ms
5,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def fact(n):
    res = 1
    while n > 0:
        res *= n
        n -= 1
    return res
    
S = raw_input()
hist = [0]*26
for s in S:
    hist[ord(s)-ord("A")] += 1
ans = fact(len(S))
for i in hist:
    ans /= fact(i)
print (ans-1)%573
0