結果

問題 No.219 巨大数の概算
ユーザー maspy
提出日時 2020-02-05 09:28:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 545 ms / 1,500 ms
コード長 435 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 44,596 KB
最終ジャッジ日時 2024-09-22 04:17:59
合計ジャッジ時間 30,732 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 51
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

N = int(readline())
AB = np.fromstring(read(), np.int64, sep=' ')

A = AB[::2]
B = AB[1::2]

L10 = np.log10(A) * B
Z = L10.astype(int)
x = np.exp((L10 - Z) * np.log(10))
X, Y = divmod((10*x).astype(int), 10)

answers = ('{} {} {}'.format(*values) for values in zip(X,Y,Z))
print('\n'.join(answers))
0