Universal Cup Judging System

Universal Cup

Süre Sınırı: 3.0 s Bellek Sınırı: 1024 MB Toplam puan: 100 Hack'lenebilir ✓
İstatistikler

Задано рядок $S$ довжини $N$, що складається з цифр $1, 2, \dots, 9$.

Розглянемо трикутну піраміду, що складається загалом із $\frac{N(N+1)}{2}$ блоків.

Піраміда поділена на $N$ рівнів, пронумерованих $1, 2, \dots, N$ згори донизу. Рівень $i$ ($1 \le i \le N$) містить $i$ блоків, розташованих в один горизонтальний ряд зліва направо. На кожному блоці написано рядок. Позначимо через $C_{i,j}$ рядок, написаний на $j$-му блоці зліва ($1 \le j \le i$) на рівні $i$.

Рядки $C_{i,j}$ задовольняють такі умови:

  • Якщо $i = N$, то $C_{i,j}$ — рядок довжини $1$, що складається з $j$-го символу рядка $S$.
  • Якщо $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.