結果

問題 No.1464 Number Conversion
ユーザー wolgnikwolgnik
提出日時 2021-04-02 23:09:01
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 383 bytes
コンパイル時間 602 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 89,428 KB
最終ジャッジ日時 2023-08-25 13:30:52
合計ジャッジ時間 8,957 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 216 ms
88,944 KB
testcase_01 AC 220 ms
88,868 KB
testcase_02 WA -
testcase_03 AC 220 ms
88,820 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 224 ms
88,708 KB
testcase_24 AC 224 ms
88,792 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 214 ms
88,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from fractions import *
input = sys.stdin.readline
def multiple_ten(s, d):
  # float with error -> int without error
  if not "." in s: return int(s) * 10 ** d
  x, r = s.split(".")
  return int(x) * 10 ** d + int(r) * 10 ** (d - len(r))

X = input()[: -1]
d = 8
res = str(Fraction(multiple_ten(X, d)) / Fraction(10 ** d))
if "." in res: print(res)
else: print(res + "/1")
0