結果

問題 No.1927 AB-CD
ユーザー zutsuzutsu
提出日時 2022-05-08 10:52:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 244 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 10,468 KB
実行使用メモリ 12,068 KB
最終ジャッジ日時 2023-09-22 05:00:01
合計ジャッジ時間 25,131 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,872 KB
testcase_01 AC 16 ms
7,964 KB
testcase_02 AC 15 ms
7,832 KB
testcase_03 AC 15 ms
7,924 KB
testcase_04 AC 1,358 ms
11,044 KB
testcase_05 AC 1,245 ms
10,868 KB
testcase_06 AC 1,180 ms
10,780 KB
testcase_07 AC 968 ms
10,356 KB
testcase_08 AC 36 ms
8,304 KB
testcase_09 AC 1,419 ms
11,148 KB
testcase_10 AC 846 ms
10,376 KB
testcase_11 AC 1,074 ms
10,708 KB
testcase_12 AC 298 ms
9,492 KB
testcase_13 AC 391 ms
9,504 KB
testcase_14 AC 24 ms
7,868 KB
testcase_15 AC 101 ms
8,952 KB
testcase_16 AC 1,138 ms
10,724 KB
testcase_17 AC 673 ms
10,080 KB
testcase_18 AC 762 ms
10,204 KB
testcase_19 AC 879 ms
10,208 KB
testcase_20 AC 1,646 ms
11,540 KB
testcase_21 AC 937 ms
10,356 KB
testcase_22 AC 220 ms
9,216 KB
testcase_23 AC 1,753 ms
11,536 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 AC 16 ms
7,908 KB
testcase_28 AC 15 ms
7,964 KB
testcase_29 AC 14 ms
8,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())
S = input()
mod = 998244353

ab = 0
for s in S:
    if s == 'A' or s == 'B':
        ab += 1

ans = math.factorial(N) * pow(math.factorial(ab),mod-2,mod) * pow(math.factorial(N-ab),mod-2,mod)
ans %= mod
print(ans)
0