結果
| 問題 |
No.1927 AB-CD
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-16 20:30:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 208 bytes |
| コンパイル時間 | 489 ms |
| コンパイル使用メモリ | 82,220 KB |
| 実行使用メモリ | 159,920 KB |
| 最終ジャッジ日時 | 2024-06-24 12:15:04 |
| 合計ジャッジ時間 | 4,381 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | AC * 4 TLE * 1 -- * 22 |
ソースコード
N = int(input())
S = input()
AB = S.count("A") + S.count("B")
A1, A2 = 1, 1
for i in range(AB):
A1 *= (N - i) % 998244353
A2 *= (i + 1) %998244353
print(A1 * pow(A2, 998244351, 998244353) % 998244353)