結果

問題 No.858 わり算
ユーザー roarisroaris
提出日時 2019-08-09 23:21:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 525 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 10,912 KB
実行使用メモリ 8,000 KB
最終ジャッジ日時 2023-09-26 22:05:18
合計ジャッジ時間 1,391 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

A, B = map(int, input().split())
a = Decimal(str(A))
b = Decimal(str(B))
getcontext().prec = 200
ans = str(a/b)

if 'E' in ans:
    s = ''
    for ans_i in ans:
        if ans_i == '-':
            break
        if ans_i != '.' and ans_i != 'E':
            s += ans_i
        
    ans = '0.'+'0'*(int(ans[-1])-1)+s
if '.' not in ans:
    ans += '.' + '0' * 100
if len(ans) < 52:
    ans += '0' * 100

for i in range(len(ans)):
    if ans[i] == '.':
        mark = i
        break
    
print(ans[:mark+1]+ans[mark+1:mark+51])
0