結果

問題 No.219 巨大数の概算
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-04-28 16:20:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 411 ms / 1,500 ms
コード長 375 bytes
コンパイル時間 310 ms
コンパイル使用メモリ 10,532 KB
実行使用メモリ 8,032 KB
最終ジャッジ日時 2023-09-25 15:24:36
合計ジャッジ時間 22,743 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 392 ms
7,920 KB
testcase_01 AC 397 ms
7,916 KB
testcase_02 AC 392 ms
7,940 KB
testcase_03 AC 399 ms
7,836 KB
testcase_04 AC 400 ms
7,980 KB
testcase_05 AC 16 ms
7,852 KB
testcase_06 AC 55 ms
7,912 KB
testcase_07 AC 16 ms
8,032 KB
testcase_08 AC 53 ms
7,896 KB
testcase_09 AC 16 ms
7,932 KB
testcase_10 AC 407 ms
7,992 KB
testcase_11 AC 398 ms
7,852 KB
testcase_12 AC 395 ms
7,836 KB
testcase_13 AC 396 ms
8,032 KB
testcase_14 AC 395 ms
7,932 KB
testcase_15 AC 395 ms
7,912 KB
testcase_16 AC 404 ms
7,984 KB
testcase_17 AC 395 ms
7,856 KB
testcase_18 AC 396 ms
7,828 KB
testcase_19 AC 396 ms
7,992 KB
testcase_20 AC 397 ms
8,028 KB
testcase_21 AC 400 ms
7,844 KB
testcase_22 AC 392 ms
7,888 KB
testcase_23 AC 399 ms
7,928 KB
testcase_24 AC 394 ms
7,928 KB
testcase_25 AC 398 ms
7,888 KB
testcase_26 AC 394 ms
7,884 KB
testcase_27 AC 395 ms
8,032 KB
testcase_28 AC 399 ms
8,032 KB
testcase_29 AC 395 ms
7,884 KB
testcase_30 AC 411 ms
7,928 KB
testcase_31 AC 394 ms
7,828 KB
testcase_32 AC 393 ms
7,884 KB
testcase_33 AC 398 ms
7,840 KB
testcase_34 AC 400 ms
7,992 KB
testcase_35 AC 395 ms
7,988 KB
testcase_36 AC 403 ms
7,836 KB
testcase_37 AC 405 ms
7,876 KB
testcase_38 AC 391 ms
7,868 KB
testcase_39 AC 397 ms
8,016 KB
testcase_40 AC 397 ms
7,928 KB
testcase_41 AC 405 ms
7,916 KB
testcase_42 AC 393 ms
7,992 KB
testcase_43 AC 401 ms
7,924 KB
testcase_44 AC 409 ms
7,920 KB
testcase_45 AC 398 ms
7,852 KB
testcase_46 AC 393 ms
7,888 KB
testcase_47 AC 396 ms
7,924 KB
testcase_48 AC 395 ms
7,884 KB
testcase_49 AC 392 ms
8,000 KB
testcase_50 AC 399 ms
7,992 KB
testcase_51 AC 15 ms
7,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())
for i in range(N):
    a, b = map(int, input().split())
    logab = b * math.log10(a)
    Z = int(logab)
    frac = logab - Z

    l = 1
    r = 10
    for j in range(100):
        m = (l + r) / 2
        if (math.log10(m) <= frac):
            l = m
        else:
            r = m

    X = int(l)
    Y = int((l - X) * 10)

    print(X, Y, Z)
0