QOJ.ac

QOJ

Límite de tiempo: 2 s Límite de memoria: 512 MB Puntuación total: 100

#1875. Nein

Estadísticas

给定 $k$ 和 $n$,求第 $n$ 个正整数 $x$,使得 $x \cdot \underbrace{999 \dots 9}_{k}$ 的十进制表示中不包含任何数字 9。

输入格式

仅一行,包含两个整数 $k$ 和 $n$ ($1 \le k \le 18, 1 \le n \le 10^{18}$)。

输出格式

输出答案。

样例

样例输入 1

1 1

样例输出 1

2

样例输入 2

1 8

样例输出 2

9

样例输入 3

1 9

样例输出 3

12

样例输入 4

1 10

样例输出 4

13

样例输入 5

5 1

样例输出 5

11112

样例输入 6

5 84

样例输出 6

11235

样例输入 7

5 668

样例输出 7

12345

样例输入 8

5 733942

样例输出 8

2281488

说明

对于 $k = 1$,所有符合条件的数字序列以 $2, 3, 4, 5, 6, 7, 8, 9, 12, 13, \dots$ 开头。

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#548Editorial Open集训队作业 解题报告 by 朱鹏睿Qingyu2026-01-02 22:09:16 Download

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.