結果

問題 No.858 わり算
ユーザー SchneeSchnee
提出日時 2019-10-20 15:56:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 447 bytes
コンパイル時間 232 ms
コンパイル使用メモリ 10,664 KB
実行使用メモリ 9,140 KB
最終ジャッジ日時 2023-09-15 14:38:11
合計ジャッジ時間 965 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 22 ms
8,868 KB
testcase_01 AC 22 ms
9,040 KB
testcase_02 AC 21 ms
9,032 KB
testcase_03 AC 21 ms
9,004 KB
testcase_04 AC 21 ms
9,044 KB
testcase_05 WA -
testcase_06 AC 21 ms
9,040 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))
elif int_num == 0:
    print(num_str[:-3])
else:
    print(num_str[:-2])
0