結果

問題 No.1464 Number Conversion
ユーザー wolgnikwolgnik
提出日時 2021-04-02 23:09:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 221 ms / 2,000 ms
コード長 383 bytes
コンパイル時間 822 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 89,368 KB
最終ジャッジ日時 2023-08-25 13:32:22
合計ジャッジ時間 8,871 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 219 ms
89,232 KB
testcase_01 AC 216 ms
89,216 KB
testcase_02 AC 215 ms
89,060 KB
testcase_03 AC 215 ms
88,988 KB
testcase_04 AC 217 ms
89,332 KB
testcase_05 AC 216 ms
89,336 KB
testcase_06 AC 219 ms
89,236 KB
testcase_07 AC 219 ms
89,064 KB
testcase_08 AC 217 ms
89,232 KB
testcase_09 AC 218 ms
89,064 KB
testcase_10 AC 217 ms
89,300 KB
testcase_11 AC 220 ms
89,368 KB
testcase_12 AC 217 ms
89,360 KB
testcase_13 AC 217 ms
89,220 KB
testcase_14 AC 213 ms
89,360 KB
testcase_15 AC 216 ms
89,064 KB
testcase_16 AC 216 ms
89,172 KB
testcase_17 AC 218 ms
89,260 KB
testcase_18 AC 219 ms
89,328 KB
testcase_19 AC 221 ms
88,976 KB
testcase_20 AC 220 ms
89,324 KB
testcase_21 AC 219 ms
89,276 KB
testcase_22 AC 217 ms
88,980 KB
testcase_23 AC 219 ms
88,980 KB
testcase_24 AC 220 ms
88,976 KB
testcase_25 AC 220 ms
89,356 KB
testcase_26 AC 215 ms
89,220 KB
testcase_27 AC 217 ms
89,292 KB
testcase_28 AC 217 ms
89,200 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