QOJ.ac

QOJ

Time Limit: 2.0 s Memory Limit: 512 MB Total points: 100

#12545. 素数列表

Statistics

Lidia 喜欢质数集合。当她感到无聊时,她会把这些集合写进她的“质数集合超长笔记本”中。

每个集合中的元素都按升序排列。每一个质数集合最终都会出现在她的笔记本中。和较小的集合总是出现在和较大的集合之前。和相同的集合按字典序升序排列:首先比较第一个元素,如果第一个元素相同,则比较第二个元素,依此类推。

为了方便他人解析她的笔记本,她以机器可读的 JSON 格式写下这些集合。当然,她在每个逗号后面都加了一个空格。以下是她笔记本的开头部分:

[2], [3], [2, 3], [5], [2, 5], [7], [3, 5], [2, 7], [2, 3, 5], [3, 7], [11], [2, 3, 7], [5, 7], [2, 11], [13], [2, 5, 7],

Lidia 想要核对她的工作,所以她向你提出了一个请求:给定两个整数 $a$ 和 $b$,输出她笔记本中从第 $a$ 个字符到第 $b$ 个字符(包含 $a$ 和 $b$,从 1 开始计数)的子串。

输入格式

第一行包含两个整数 $a$ 和 $b$ ($1 \le a \le b \le 10^{18}$; $b - a \le 10^5$)。

输出格式

输出题目描述中要求的笔记本从位置 $a$ 到位置 $b$ 的子串。你必须输出一行,包含恰好 $b - a + 1$ 个字符,包括任何前导和/或尾随空格。

样例

输入 1

1 35

输出 1

[2], [3], [2, 3], [5], [2, 5], [7],

输入 2

36 41

输出 2

[3, 5

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.