No.1666 Perfect Powers
問題文最終更新日: 2021-09-02 22:01:18
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 312
(順位表)
の他の問題:
Problem Statement
A positive integer that can be expressed as $a^b$ using positive integers $a,b\ (a\geq 1,b\geq2)$ is called a perfect power.
Find the $K$-th smallest perfect power.
You are given $T$ test cases.
Input
$T$ $case_1$ $\vdots$ $case_T$Each case is given in the following format.
$K$
- $1\leq T\leq 500$
- $1\leq K\leq10^9$
- All inputs are integers.
Output
Print $T$ lines. On the $i$-th line, print the $K$-th smallest perfect power for the $K$ of the $i$-th test case.
Sample
Sample 1
Input
10 1 2 3 4 5 6 7 8 9 10
Output
1 4 8 9 16 25 27 32 36 49
The $10$ smallest perfect powers, in ascending order, are $1(=1^2=1^3=\ldots),\ 4(=2^2),\ 8(=2^3),\ 9(=3^2),\ 16(=2^4=4^2),\ 25(=5^2),\ 27(=3^3),\ 32(=2^5),\ 36(=6^2),\ 49(=7^2)$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
とりゐ
re_re0101