QOJ.ac

QOJ

Time Limit: 2 s Memory Limit: 512 MB Total points: 100 Difficulty: [show]

#1875. いいえ

Statistics

$k$ と $n$ が与えられます。$x\cdot\underbrace{999\ldots9}_{k}$ の十進表記に数字 $9$ が一つも含まれないような正の整数 $x$ のうち、小さい方から $n$ 番目を求めてください。

入力

唯一の行に二つの整数 $k,n$($1\le k\le18$、$1\le n\le10^{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,\ldots$ で始まります。

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#548Editorial Open集训队作业 解题报告 by 朱鹏睿Qingyu 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.