#A. 翻转数码(reverse)

    Type: Default 1000ms 256MiB

翻转数码(reverse)

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.

巡有一个函数 f(x)f(x) 表示 xx 反转各位数字后去掉前导零得到正整数。如:f(140)=41f(140)=41

巡有 TT 个询问,每次询问一个正整数 xx。你需要找出最小的正整数 nn 使得 f(n)>xf(n)>x

输入格式

第一行一个正整数表示 TT

接下来 TT 行,每行一个正整数表示 nn

输出格式

TT 行,每行一个正整数表示答案。

样例 #1

【样例输入】

3
12
991
114514

【样例输出】

12
299
100002

【样例解释】

  • f(12)=21>12f(12)=21>12
  • f(299)=992>991f(299)=992>991
  • f(10002)=20001>114514f(10002)=20001>114514

样例 #2

见下发样例 reverse2.in/ans\textit{reverse2.in/ans}

数据范围

测试点编号 TT\leq nn\leq
11 1010 100100
22 10510^5 101810^{18}

NOIP 2024 模拟赛(五)hard

Not Attended
Status
Done
Rule
OI
Problem
4
Start at
2024-8-14 8:00
End at
2024-8-14 12:00
Duration
4 hour(s)
Host
Partic.
29