結果

問題 No.1927 AB-CD
ユーザー hiro1729hiro1729
提出日時 2024-02-23 09:06:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 126 ms / 2,000 ms
コード長 180 bytes
コンパイル時間 358 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 75,944 KB
最終ジャッジ日時 2024-02-23 09:06:23
合計ジャッジ時間 4,862 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,332 KB
testcase_01 AC 37 ms
53,332 KB
testcase_02 AC 38 ms
53,332 KB
testcase_03 AC 37 ms
53,332 KB
testcase_04 AC 109 ms
75,764 KB
testcase_05 AC 107 ms
75,740 KB
testcase_06 AC 105 ms
75,732 KB
testcase_07 AC 98 ms
75,688 KB
testcase_08 AC 51 ms
70,320 KB
testcase_09 AC 108 ms
75,772 KB
testcase_10 AC 94 ms
75,660 KB
testcase_11 AC 101 ms
75,712 KB
testcase_12 AC 74 ms
75,312 KB
testcase_13 AC 84 ms
75,312 KB
testcase_14 AC 49 ms
66,224 KB
testcase_15 AC 63 ms
75,312 KB
testcase_16 AC 104 ms
75,724 KB
testcase_17 AC 89 ms
75,616 KB
testcase_18 AC 92 ms
75,640 KB
testcase_19 AC 97 ms
75,668 KB
testcase_20 AC 115 ms
75,816 KB
testcase_21 AC 97 ms
75,680 KB
testcase_22 AC 70 ms
75,312 KB
testcase_23 AC 119 ms
75,868 KB
testcase_24 AC 126 ms
75,944 KB
testcase_25 AC 125 ms
75,944 KB
testcase_26 AC 125 ms
75,944 KB
testcase_27 AC 37 ms
53,332 KB
testcase_28 AC 37 ms
53,332 KB
testcase_29 AC 38 ms
53,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = input()
a = S.count('A')
b = S.count('B')
x = a + b
ans = 1
mod = 998244353
for i in range(x):
	ans *= pow(i + 1, -1, mod)
	ans *= N - i
	ans %= mod
print(ans)
0