#abc343c. C - 343
C - 343
Score: points
问题描述
给定一个正整数 。
找出不大于 的回文立方数中的最大值。
这里,一个正整数 被定义为回文立方数,当且仅当它满足以下两个条件:
- 存在一个正整数 ,使得 。
- 不带前导零的 的十进制表示是一个回文。具体来说,如果 表示为 ,其中 是介于 和 (包含)之间的整数,而整数 介于 和 (包含)之间,则对于所有 ,都有 。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
You are given a positive integer .
Find the maximum value of a palindromic cube number not greater than .
Here, a positive integer is defined to be a palindromic cube number if and only if it satisfies the following two conditions:
- There is a positive integer such that .
- The decimal representation of without leading zeros is a palindrome. More precisely, if is represented as using integers between and , inclusive, and an integer between and , inclusive, then for all .
Constraints
- is a positive integer not greater than .
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
345
Sample Output 1
343
is a palindromic cube number, while and are not. Thus, the answer is .
Sample Input 2
6
Sample Output 2
1
Sample Input 3
123456789012345
Sample Output 3
1334996994331
update @ 2024/3/10 01:15:50