結果

問題 No.858 わり算
ユーザー SchneeSchnee
提出日時 2019-10-20 16:24:15
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 430 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 10,596 KB
実行使用メモリ 9,084 KB
最終ジャッジ日時 2023-09-15 14:38:32
合計ジャッジ時間 1,025 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,960 KB
testcase_01 AC 20 ms
8,948 KB
testcase_02 AC 20 ms
8,988 KB
testcase_03 AC 21 ms
8,996 KB
testcase_04 AC 20 ms
9,084 KB
testcase_05 AC 21 ms
8,936 KB
testcase_06 AC 20 ms
9,080 KB
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = str(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