結果

問題 No.219 巨大数の概算
ユーザー convexineq
提出日時 2020-12-19 11:13:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 163 ms / 1,500 ms
コード長 348 bytes
コンパイル時間 278 ms
コンパイル使用メモリ 82,032 KB
実行使用メモリ 78,080 KB
最終ジャッジ日時 2024-09-21 10:10:34
合計ジャッジ時間 10,040 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
from math import log
from bisect import bisect_left
res = [-1.0] + [log(i/10,10) for i in range(1,101)]

for _ in range(n):
    a,b = map(int,input().split())
    c = b*log(a,10)
    z = int(c)
    idx = bisect_left(res, c-z) - 1
    if idx <= 9: idx = 10
    if idx >= 100: idx = 99
    x = idx//10
    y = idx%10
    print(x,y,z)
0