QOJ.ac

QOJ

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

#1875. Non

Statistics

Étant donnés $k$ et $n$, trouvez le $n$-ième plus petit entier strictement positif $x$ tel que la représentation décimale de $x\cdot\underbrace{999\ldots9}_{k}$ ne contienne aucun chiffre $9$.

Entrée

L’unique ligne contient deux entiers $k$ et $n$ ($1\le k\le18$, $1\le n\le10^{18}$).

Sortie

Affichez la réponse.

Exemples

Entrée 1

1 1

Sortie 1

2

Entrée 2

1 8

Sortie 2

9

Entrée 3

1 9

Sortie 3

12

Entrée 4

1 10

Sortie 4

13

Entrée 5

5 1

Sortie 5

11112

Entrée 6

5 84

Sortie 6

11235

Entrée 7

5 668

Sortie 7

12345

Entrée 8

5 733942

Sortie 8

2281488

Remarque

Pour $k=1$, la suite de tous les nombres valides commence par $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.