AtCoder Grand Contest 046
翻译中…
Problem Statement
翻译中…
Given is a string $S$ consisting of 0 and 1. Find the number of strings, modulo $998244353$, that can result from applying the following operation on $S$ between $0$ and $K$ times (inclusive):
翻译中…
- Choose a pair of integers
$i, j$$(1\leq i < j\leq |S|)$such that the$i$-th and$j$-th characters of$S$are0and1, respectively. Remove the$j$-th character from$S$and insert it to the immediate left of the$i$-th character.
翻译中…
Constraints
翻译中…
$1 \leq |S| \leq 300$$0 \leq K \leq 10^9$$S$consists of0and1.
翻译中…
Input
翻译中…
Input is given from Standard Input in the following format:
翻译中…
S K
翻译中…
Output
翻译中…
Find the number of strings, modulo $998244353$, that can result from applying the operation on $S$ between $0$ and $K$ times (inclusive).
翻译中…
样例
Input #1
0101 1
Output #1
4
Four strings, `0101`, `0110`, `1001`, and `1010`, can result.
Input #2
01100110 2
Output #2
14
Input #3
1101010010101101110111100011011111011000111101110101010010101010101 20
Output #3
113434815
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。