Score : 800 points
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):
0
and 1
, respectively. Remove the j-th character from S and insert it to the immediate left of the i-th character.0
and 1
.Input is given from Standard Input in the following format:
S K
Find the number of strings, modulo 998244353, that can result from applying the operation on S between 0 and K times (inclusive).
0101 1
4
Four strings, 0101
, 0110
, 1001
, and 1010
, can result.
01100110 2
14
1101010010101101110111100011011111011000111101110101010010101010101 20
113434815