問題一覧 > 通常問題

No.2772 Appearing Even Times

レベル : / AI推定難易度 : 1700 / 実行時間制限 : 1ケース 4.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 68
作問者 : 👑 binap / テスター : 👑 p-adic
お気に入りにしたユーザー ProblemId : 10892 / 自分の提出
問題文最終更新日: 2024-05-28 08:02:03
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder contest 431 (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。