結果

問題 No.171 スワップ文字列(Med)
ユーザー noko2250noko2250
提出日時 2015-03-23 18:06:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 357 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 10,676 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2023-09-11 09:45:32
合計ジャッジ時間 1,000 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 16 ms
7,968 KB
testcase_02 RE -
testcase_03 WA -
testcase_04 WA -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 15 ms
7,788 KB
testcase_11 AC 15 ms
7,920 KB
testcase_12 AC 16 ms
7,796 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/c/Python34/python
# coding: utf-8


def main():
    S = input()
    ans = 1
    a = [0] * 26
    for i in range(len(S)):
        ans *= i+1
        a[ord(S[i])-ord('A')] += 1

    for i in range(26):
        while a[i] > 1:
            ans /= a[i]
            a[i] -= 1

    mod = 573
    print((int(ans)-1) % mod)

if __name__ == '__main__':
    main()
0