問題一覧 > 通常問題

No.2437 Fragile Multiples of 11

レベル : / AI推定難易度 : 2025 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 26
作問者 : Nzt3 / テスター : ebi_fly noya2 👑 potato167
お気に入りにしたユーザー ProblemId : 10000 / 自分の提出
問題文最終更新日: 2024-04-26 12:58:42
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
traP 作問ハッカソンコンテスト 001 (順位表) の他の問題:

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