Universal Cup Judging System

Universal Cup

시간 제한: 3.0 s 메모리 제한: 1024 MB 총점: 100 해킹 가능 ✓
통계

畀你一個長度為 $N$ 且僅由數字 $1, 2, \dots, 9$ 組成嘅字串 $S$。

考慮一個由總共 $\frac{N(N+1)}{2}$ 個方塊組成嘅三角金字塔。

呢個金字塔自頂向下分為 $N$ 層,編號為 $1, 2, \dots, N$。第 $i$ 層($1 \le i \le N$)包含 $i$ 個方塊,從左到右排成一橫排。每個方塊上面都寫住一個字串。記 $C_{i,j}$ 為第 $i$ 層入面從左往右數第 $j$ 個方塊($1 \le j \le i$)上面寫嘅字串。

字串 $C_{i,j}$ 滿足以下條件:

  • 如果 $i = N$,則 $C_{i,j}$ 係由 $S$ 嘅第 $j$ 個字符組成嘅長度為 $1$ 嘅字串。
  • 如果 $1 \le i < N$,則 $C_{i,j}$ 係將 $C_{i+1,j}$ 同 $C_{i+1,j+1}$ 按呢個順序拼接而成嘅字串。

將 $C_{1,1}$ 視為一個十進制整數,計算佢對 $998244353$ 取模嘅值。

輸入格式

輸入按以下格式畀出:

N
S
  • $N$ 係一個整數。
  • $1 \le N \le 2 \times 10^5$。
  • $S$ 係一個長度為 $N$ 且僅由數字 $1, 2, \dots, 9$ 組成嘅字串。

輸出格式

輸出答案。

範例

輸入範例 1

4
8192

輸出範例 1

81191992

輸入範例 2

1
5

輸出範例 2

5

輸入範例 3

14
11123455678999

輸出範例 3

913063116

提示

喺第一個範例入面,$S = 8192$。根據規則構建金字塔,我哋得到 $C_{1,1} = 81191992$。

problem_16231_1.png

喺第二個範例入面,$S = 5$。金字塔僅由一個方塊組成,且 $C_{1,1} = 5$。

problem_16231_2.png

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.