結果

問題 No.171 スワップ文字列(Med)
ユーザー titiatitia
提出日時 2022-04-28 00:45:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 271 ms / 1,000 ms
コード長 364 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 10,788 KB
実行使用メモリ 64,344 KB
最終ジャッジ日時 2023-09-10 16:44:01
合計ジャッジ時間 4,672 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 259 ms
64,152 KB
testcase_01 AC 270 ms
64,172 KB
testcase_02 AC 269 ms
64,164 KB
testcase_03 AC 269 ms
64,172 KB
testcase_04 AC 264 ms
64,156 KB
testcase_05 AC 269 ms
64,160 KB
testcase_06 AC 262 ms
64,312 KB
testcase_07 AC 271 ms
64,204 KB
testcase_08 AC 264 ms
64,344 KB
testcase_09 AC 267 ms
64,312 KB
testcase_10 AC 265 ms
64,204 KB
testcase_11 AC 267 ms
64,332 KB
testcase_12 AC 264 ms
64,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

S=input()

mod=573

N=1020

Combi=[[] for i in range(N+1)]
Combi[0]=[1,0]

for i in range(1,N+1):
    Combi[i].append(1)
    for j in range(i):
        Combi[i].append(Combi[i-1][j]+Combi[i-1][j+1])
    Combi[i].append(0)

C=Counter(S)
ANS=1
n=len(S)
for c in C:
    ANS*=Combi[n][C[c]]
    n-=C[c]
    ANS%=mod

print((ANS-1)%mod)
0