結果
問題 |
No.1927 AB-CD
|
ユーザー |
|
提出日時 | 2024-02-23 09:06:17 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 113 ms / 2,000 ms |
コード長 | 180 bytes |
コンパイル時間 | 222 ms |
コンパイル使用メモリ | 82,600 KB |
実行使用メモリ | 76,600 KB |
最終ジャッジ日時 | 2024-09-29 04:56:06 |
合計ジャッジ時間 | 3,704 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
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)