No.2437 Fragile Multiples of 11
Problem Statement
You are given an $N$-digit positive integer $X$. Find the number of "fragile multiples of $11$" less than or equal to $X$, modulo $998244353$.
Here, $x$ is called a "fragile multiple of $11$" if, for an integer $x$ greater than or equal to $10$, both of the following 2 conditions hold.
- $x$ is a multiple of $11$
- None of the positive integers formed by deleting $1$ digit from $x$, written in decimal without extra leading $0$s, is a multiple of $11$
- Deleting the $2$nd digit from the top of $1234$, which is $2$, gives $134$
- Deleting the $1$st digit from the top of $1023$, which is $1$, gives $023 = 23$
Constraints
- $1 \leq N \leq 100$
- $N$ is an integer
- $X$ is an $N$-digit positive integer
- The most significant digit of $X$ is not 0
Input
$N$ $X$
Output
Print the answer on $1$ line. Do not forget to output the remainder modulo $998244353$.
Sample
Sample 1
Input
2 11
Output
1
$11$ is a "fragile multiple of $11$".
Sample 2
Input
3 121
Output
9
$11,22,33,44,55,66,77,88,99$ are "fragile multiples of $11$".
Sample 3
Input
11 27775304230
Output
1
Give the answer modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
noya2