結果

問題 No.1927 AB-CD
ユーザー pluto77
提出日時 2022-05-29 16:22:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 189 bytes
コンパイル時間 239 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 60,892 KB
最終ジャッジ日時 2024-09-21 00:13:50
合計ジャッジ時間 3,049 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki1927
n=int(input())
s=input()
ab=s.count("A")+s.count("B")
mod=998244353
res1=1
res2=1
for i in range(ab):
 res1=res1*(n-i)%mod
 res2=res2*(i+1)%mod
print(res1*pow(res2,mod-2,mod)%mod)
0