結果

問題 No.858 わり算
ユーザー SchneeSchnee
提出日時 2019-10-20 16:47:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 440 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 10,564 KB
実行使用メモリ 9,004 KB
最終ジャッジ日時 2023-09-15 14:38:46
合計ジャッジ時間 886 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
9,004 KB
testcase_01 AC 22 ms
8,864 KB
testcase_02 AC 21 ms
8,980 KB
testcase_03 AC 22 ms
8,928 KB
testcase_04 AC 21 ms
8,992 KB
testcase_05 AC 22 ms
8,932 KB
testcase_06 AC 21 ms
8,968 KB
testcase_07 AC 21 ms
8,928 KB
testcase_08 AC 21 ms
8,932 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import *
num1, num2 = input().strip().split()

int_num = int(num1) // int(num2)
int_len = len(str(int(num1) // int(num2)))
getcontext().prec = 52 + int_len

num_str = '{:f}'.format(Decimal(num1) / Decimal(num2))
length = len(num_str)

if length == int_len:
    print(num_str + "." + "0" * 50)
elif length - int_len < 51:
    print(num_str + "0" * (51 + int_len - length))
else:
    print(num_str[:-2 - (length - int_len - 53)])
0