結果

問題 No.1927 AB-CD
ユーザー 👑 KazunKazun
提出日時 2022-05-06 21:34:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 104 ms / 2,000 ms
コード長 254 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 91,148 KB
最終ジャッジ日時 2023-09-20 02:27:34
合計ジャッジ時間 4,317 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,320 KB
testcase_01 AC 73 ms
71,256 KB
testcase_02 AC 73 ms
71,424 KB
testcase_03 AC 73 ms
71,644 KB
testcase_04 AC 101 ms
87,536 KB
testcase_05 AC 101 ms
86,796 KB
testcase_06 AC 100 ms
86,784 KB
testcase_07 AC 97 ms
85,528 KB
testcase_08 AC 80 ms
76,604 KB
testcase_09 AC 101 ms
87,812 KB
testcase_10 AC 89 ms
79,124 KB
testcase_11 AC 98 ms
85,920 KB
testcase_12 AC 84 ms
77,776 KB
testcase_13 AC 85 ms
77,748 KB
testcase_14 AC 81 ms
76,148 KB
testcase_15 AC 82 ms
76,856 KB
testcase_16 AC 95 ms
86,492 KB
testcase_17 AC 84 ms
78,900 KB
testcase_18 AC 88 ms
79,032 KB
testcase_19 AC 88 ms
79,436 KB
testcase_20 AC 102 ms
88,748 KB
testcase_21 AC 90 ms
79,432 KB
testcase_22 AC 85 ms
77,548 KB
testcase_23 AC 103 ms
89,612 KB
testcase_24 AC 104 ms
90,736 KB
testcase_25 AC 104 ms
90,704 KB
testcase_26 AC 103 ms
91,148 KB
testcase_27 AC 74 ms
71,608 KB
testcase_28 AC 75 ms
71,128 KB
testcase_29 AC 75 ms
71,476 KB
権限があれば一括ダウンロードができます

ソースコード

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