結果
問題 |
No.171 スワップ文字列(Med)
|
ユーザー |
![]() |
提出日時 | 2022-04-28 00:43:38 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 359 bytes |
コンパイル時間 | 76 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 66,560 KB |
最終ジャッジ日時 | 2024-06-28 07:50:41 |
合計ジャッジ時間 | 5,197 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 WA * 3 |
ソースコード
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)