結果
問題 |
No.219 巨大数の概算
|
ユーザー |
![]() |
提出日時 | 2025-04-15 22:43:03 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 520 bytes |
コンパイル時間 | 392 ms |
コンパイル使用メモリ | 81,816 KB |
実行使用メモリ | 105,888 KB |
最終ジャッジ日時 | 2025-04-15 22:44:12 |
合計ジャッジ時間 | 6,107 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 1 |
other | TLE * 1 -- * 50 |
ソースコード
import decimal from decimal import Decimal, ROUND_FLOOR decimal.getcontext().prec = 25 # Sufficient precision to handle large exponents n = int(input()) for _ in range(n): a, b = map(int, input().split()) log10_a = Decimal(a).log10() log10_val = log10_a * Decimal(b) z = log10_val // 1 f = log10_val - z v = Decimal(10) ** f v_rounded = v.quantize(Decimal('0.1'), rounding=ROUND_FLOOR) x = int(v_rounded // 1) y = int((v_rounded % 1) * 10) z_int = int(z) print(x, y, z_int)