Universal Cup Judging System

Universal Cup

Time Limit: 3.0 s Memory Limit: 1024 MB Total points: 100 Hackable ✓
Statistics

Ti viene data una stringa $S$ di lunghezza $N$ composta dalle cifre $1, 2, \dots, 9$.

Considera una piramide triangolare composta in totale da $\frac{N(N+1)}{2}$ blocchi.

La piramide è divisa in $N$ livelli, numerati $1, 2, \dots, N$ dall'alto verso il basso. Il livello $i$ ($1 \le i \le N$) contiene $i$ blocchi disposti su un'unica riga orizzontale da sinistra a destra. Su ciascun blocco è scritta una stringa. Sia $C_{i,j}$ la stringa scritta sul $j$-esimo blocco da sinistra ($1 \le j \le i$) nel livello $i$.

Le stringhe $C_{i,j}$ soddisfano le seguenti condizioni:

  • Se $i = N$, allora $C_{i,j}$ è la stringa di lunghezza $1$ costituita dal $j$-esimo carattere di $S$.
  • Se $1 \le i < N$, allora $C_{i,j}$ è la concatenazione di $C_{i+1,j}$ e $C_{i+1,j+1}$, in questo ordine.

Interpreta $C_{1,1}$ come un intero decimale e calcola il suo valore modulo $998244353$.

Input

L'input è fornito nel seguente formato:

N
S
  • $N$ è un intero.
  • $1 \le N \le 2 \times 10^5$.
  • $S$ è una stringa di lunghezza $N$ composta dalle cifre $1, 2, \dots, 9$.

Output

Stampa la risposta.

Esempi

Input 1

4
8192

Output 1

81191992

Input 2

1
5

Output 2

5

Input 3

14
11123455678999

Output 3

913063116

Nota

Nel primo esempio, $S = 8192$. Costruendo la piramide secondo le regole, otteniamo $C_{1,1} = 81191992$.

problem_16231_1.png

Nel secondo esempio, $S = 5$. La piramide è composta da un singolo blocco, e $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.