QOJ.ac

QOJ

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

#1875. Não

Statistics

Dados $k$ e $n$, encontre o $n$-ésimo menor inteiro positivo $x$ tal que a representação decimal de $x\cdot\underbrace{999\ldots9}_{k}$ não contenha nenhum algarismo $9$.

Entrada

A única linha contém dois inteiros $k$ e $n$ ($1\le k\le18$, $1\le n\le10^{18}$).

Saída

Imprima a resposta.

Exemplos

Entrada 1

1 1

Saída 1

2

Entrada 2

1 8

Saída 2

9

Entrada 3

1 9

Saída 3

12

Entrada 4

1 10

Saída 4

13

Entrada 5

5 1

Saída 5

11112

Entrada 6

5 84

Saída 6

11235

Entrada 7

5 668

Saída 7

12345

Entrada 8

5 733942

Saída 8

2281488

Nota

Para $k=1$, a sequência de todos os números válidos começa com $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.