問題一覧 > 通常問題

No.219 Approximation of Huge Numbers

レベル : / 実行時間制限 : 1ケース 1.500秒 / メモリ制限 : 256 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (AC するまで非表示) / 解いたユーザー数 180
作問者 : ciel
お気に入りにしたユーザー ProblemId : 593 / 自分の提出
問題文最終更新日: 2026-06-28 12:25:29
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 107 (順位表) の他の問題:

Problem Statement

We want to approximate powers.
$A^B ≒ X.Y * 10^Z$ (A, B, X, Y, Z are integers, X is between 1 and 9 inclusive, Y is between 0 and 9 inclusive, and digits below Y are truncated)
Multiple pairs of A, B are given; find the corresponding X, Y, Z. Note that Z is never 0.

However, as an error tolerance, when valid outputs are ordered by the values they represent, the values immediately adjacent to the expected solution's output are also accepted.
For example, when the expected solution is $1.0*10^8$
        1 0 8 
the following two are also considered correct.
$1.1*10^8$
        1 1 8
$9.9*10^7$
        9 9 7

Input

$N$
$A_1\ B_1$
...
$A_N\ B_N$

$A,B$: parameters of the power
$1 \le N \le 10000$
$2 \le A \le 2100000000, 2 \le B \le 2100000000$
$(10 \le A^B)$

Output

$X_1\ Y_1\ Z_1$
...
$X_N\ Y_N\ Z_N$

$X,Y,Z$: the result of the approximation

Sample

Sample 1
Input
2
2 10
9 9
Output
1 0 3
3 8 8

99 is 387420489. This is a 9-digit number (on the order of 108), whose most significant digit is 3 and second digit from the top is 8. The third digit from the top is 7, but it is truncated.

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。