結果
| 問題 | No.171 スワップ文字列(Med) |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-04-28 00:45:07 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 306 ms / 1,000 ms |
| コード長 | 364 bytes |
| 記録 | |
| コンパイル時間 | 588 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 67,932 KB |
| 最終ジャッジ日時 | 2026-03-16 19:31:17 |
| 合計ジャッジ時間 | 5,317 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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)
titia