Type: RemoteJudge 1000ms 128MiB

[ROIR 2021 Day 2] 好数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目背景

译自 ROIR 2021 Day2 T2 Числа

题目描述

定义第一类好数为所有数位上的数字均相同的数。

定义第二类好数为满足如下任意一个条件的数:

  • 为第一类好数。
  • tt 为数的位数,则有 t1t-1 位数上的数字相同,且无前导零。

现给定一个 xx,求出 x\ge x 的第一个第 k+1k+1 类好数 yy

输入格式

第一行一个整数 xx

第二行一个整数 kk

输出格式

一行一个整数 yy

700
0
777
700
1
700

提示

对于所有子任务 1x10171\le x\le 10^{17}k{0,1}k\in\{0,1\}

子任务编号 特殊限制 分值
11 1x1051\le x\le 10^5k=0k=0 1515
22 k=0k=0 2020
33 1x1051\le x\le 10^5 2121
44 无特殊限制 4444

CSP难度的题目

Not Attended
Status
Done
Rule
IOI
Problem
19
Start at
2024-10-28 8:00
End at
2024-10-30 8:00
Duration
48 hour(s)
Host
Partic.
14