問題一覧 > 通常問題

No.2995 The Ruler Sequence Concatenation

レベル : / AI推定難易度 : 2400 / 実行時間制限 : 1ケース 1.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (AC するまで非表示) / 解いたユーザー数 11
作問者 : noshi91 / テスター : 👑 Nachia
お気に入りにしたユーザー ProblemId : 11727 / 自分の提出
問題文最終更新日: 2024-12-19 11:30:22
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
Advent Calendar Contest 2024 (順位表) の他の問題:

Background

This problem was originally proposed by kroton and solved by noshi91.

Problem Statement

Define the sequence of positive integers $R _ n$ as follows.

  • $R _ 1 = 1$
  • $R _ n = \operatorname{cat}(R _ {n - 1}, n, R _ {n - 1}) \quad (n \geq 2)$
Here, $\operatorname{cat}$ is the function that writes its arguments in decimal notation, concatenates them, and interprets the result as a decimal number again. For example, $R _ 3 = 1213121$.
Given $n$, output $R _ n \bmod 998244353$.

Input

$n$

  • $1 \leq n \lt 10^{18}$
  • $n$ is an integer

Output

$R _ n$

Output the remainder when divided by $998244353$.

Sample

Sample 1
Input
3
Output
1213121

Sample 2
Input
10
Output
269257815

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。