結果

問題 No.1927 AB-CD
ユーザー 👑 Kazun
提出日時 2022-05-06 21:34:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 89,856 KB
最終ジャッジ日時 2024-07-05 22:47:30
合計ジャッジ時間 2,715 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

def nCr(n,r):
    a=b=1
    while r:
        a*=n; a%=Mod; n-=1
        b*=r; b%=Mod; r-=1
    return a*pow(b,Mod-2,Mod)%Mod

Mod=998244353
N=int(input())
S=list(input())

A,B,C,D="ABCD"
r=0
for s in S:
    if s==A or s==B:
        r+=1

print(nCr(N,r))
0