結果

問題 No.858 わり算
ユーザー NoneNone
提出日時 2021-03-01 01:38:18
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 471 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 82,428 KB
実行使用メモリ 53,532 KB
最終ジャッジ日時 2024-04-14 03:25:31
合計ジャッジ時間 1,549 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,004 KB
testcase_01 AC 37 ms
51,884 KB
testcase_02 AC 35 ms
52,088 KB
testcase_03 AC 35 ms
53,124 KB
testcase_04 AC 35 ms
53,036 KB
testcase_05 AC 37 ms
52,860 KB
testcase_06 AC 36 ms
53,532 KB
testcase_07 AC 36 ms
52,404 KB
testcase_08 AC 36 ms
52,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def digit_shift_inv(N,l,digit):
    S=str(N)
    L=len(S)
    if l==0:
        return S
    elif L<=l:
        f="0"*(l-L)+S
        if len(f)>=digit:
            return "0."+f[:digit]
        else:
            return "0."+f+"0"*(digit-l)
    else:
        f=S[-l:]
        if len(f)>=digit:
            return S[:-l]+"."+f[:digit]
        else:
            return S[:-l]+"."+"0"*(digit-l)


A,B=map(int, input().split())
L=50
M=10**L
print(digit_shift_inv(A*M//B,L,50))
0