103633: [Atcoder]ABC363 D - Palindromic Number
Memory Limit:256 MB
Time Limit:2 S
Judge Style:Text Compare
Creator:
Submit:8
Solved:0
Description
Score : $350$ points
Problem Statement
A non-negative integer $X$ is called a palindrome number if its decimal representation (without leading zeros) is a palindrome.
For example, $363$, $12344321$, and $0$ are all palindrome numbers.
Find the $N$-th smallest palindrome number.
Constraints
- $1 \leq N \leq 10^{18}$
- $N$ is an integer.
Input
The input is given from Standard Input in the following format:
$N$
Output
Print the $N$-th smallest palindrome number.
Sample Input 1
46
Sample Output 1
363
The 46th smallest palindrome number is $363$.
Sample Input 2
1
Sample Output 2
0
Sample Input 3
1000000000000000000
Sample Output 3
90000000000000000000000000000000009
Output
得分:$350$分
问题陈述
一个非负整数$X$被称为回文数,如果它的十进制表示(没有前导零)是一个回文。
例如,$363$,$12344321$和$0$都是回文数。
找到第$N$个最小的回文数。
约束条件
- $1 \leq N \leq 10^{18}$
- $N$是一个整数。
输入
输入从标准输入以下格式给出:
$N$
输出
打印第$N$个最小的回文数。
示例输入1
46
示例输出1
363
第46个最小的回文数是$363$。
示例输入2
1
示例输出2
0
示例输入3
1000000000000000000
示例输出3
90000000000000000000000000000000009