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