結果
| 問題 | No.171 スワップ文字列(Med) |
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2022-04-28 00:45:07 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 215 ms / 1,000 ms |
| + 89µs | |
| コード長 | 364 bytes |
| 記録 | |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 14,464 KB |
| 実行使用メモリ | 66,432 KB |
| 最終ジャッジ日時 | 2026-11-03 10:42:33 |
| 合計ジャッジ時間 | 5,060 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge7_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
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