QOJ.ac

QOJ

Limite de temps : 6 s Limite de mémoire : 256 MB Points totaux : 100 Hackable ✓

#13030. 奇怪的序列

Statistiques

考虑以下由数字字符串组成的著名序列 $s$。令 $s_0 = \text{“2”}$。每一项都是通过描述前一项得到的:将前一项拆分为连续的相同数字组,对于每一组,写出该组的大小,紧接着写出该组所包含的数字。因此,前几项的构造如下:

字符串 描述
$s_0 = \text{“2”}$ 一个 2
$s_1 = \text{“12”}$ 一个 1,一个 2
$s_2 = \text{“1112”}$ 三个 1,一个 2
$s_3 = \text{“3112”}$ 一个 3,两个 1,一个 2
$s_4 = \text{“132112”}$ 一个 1,一个 3,一个 2,两个 1,一个 2
$s_5 = \text{“1113122112”}$ ...

你的任务是求出该序列第 $n$ 项的长度,结果对 $7\,340\,033$ 取模。

输入格式

输入的第一行包含一个整数 $n$ ($0 \le n \le 10^{18}$)。

输出格式

输出 $s_n$ 的长度对 $7\,340\,033$ 取模的结果。

样例

输入 1

0

输出 1

1

输入 2

2

输出 2

4

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.