結果

問題 No.171 スワップ文字列(Med)
ユーザー titiatitia
提出日時 2022-04-28 00:43:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 359 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,956 KB
実行使用メモリ 64,324 KB
最終ジャッジ日時 2023-09-10 16:43:53
合計ジャッジ時間 5,065 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 257 ms
64,196 KB
testcase_01 AC 275 ms
64,324 KB
testcase_02 AC 263 ms
64,160 KB
testcase_03 AC 261 ms
64,220 KB
testcase_04 AC 258 ms
64,220 KB
testcase_05 WA -
testcase_06 AC 260 ms
64,168 KB
testcase_07 AC 274 ms
64,264 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 263 ms
64,248 KB
testcase_11 AC 263 ms
64,168 KB
testcase_12 AC 264 ms
64,208 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)
0