Problem Statement
There are $N$ squares: square $1$, square $2$, $\ldots$, square $N$. Each square is colored red or blue. The colors of the squares are represented by a string $S$ of length $N$. Specifically, for each $i = 1, 2, \ldots, N$, square $i$ is colored red if the $i$-th character of $S$ is R, and blue if it is B. Square $N$ is always colored blue.
Initially, each square has a chip of the same color as the square.
For each $i = 1, 2, \ldots, N-1$ in this order, let us perform the following operation.
- Choose an integer
$j$such that$i \lt j \leq N$and square$j$is colored blue, and place the pile of chips on square$i$on top of the pile of chips on square$j$, keeping the order of the chips.
Print the number of possible sequences of colors of chips of the $N$-chip pile on square $N$ from top to bottom after the above process, modulo $998244353$.
Constraints
$2 \leq N \leq 300$$N$is an integer.$S$is a string of length$N$consisting ofRandB.- The
$N$-th character of$S$isB.
Input
The input is given from Standard Input in the following format:
N
S
Output
Print the answer.
样例
4
RBRB
2
20
RRBRRRBBRBBBBRBRBRBB
92378
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。