No.2772 Appearing Even Times
Problem Statement
A positive integer $X$ is defined to be a good number if, when $X$ is written in decimal notation (without leading $0$s), each digit from $0$ to $9$ appears an even number of times.
For example, $77$ and $144100$ are good numbers, since each digit appears an even number of times. $110$ and $1213$ are not good numbers.
Find the number of good numbers among the positive integers less than or equal to $N$. Since the answer can be very large, compute the remainder when the answer is divided by the prime $998244353$.
Input
$N$
$1 \leq N \leq 10^{10000}$
$N$ is a positive integer.
Output
Output the remainder when the answer is divided by $998244353$ on one line. Print a newline at the end.
Sample
Sample 1
Input
1019
Output
11
The good numbers less than or equal to $1019$ are the following $11$ numbers: $11, 22, 33, \ldots, 99, 1001, 1010$.
Sample 2
Input
37181
Output
261
Sample 3
Input
31415926535897
Output
15778096
Output the remainder when divided by the prime $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。