結果

問題 No.1464 Number Conversion
ユーザー wolgnikwolgnik
提出日時 2021-04-02 21:44:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 86,876 KB
実行使用メモリ 89,404 KB
最終ジャッジ日時 2023-08-25 11:54:16
合計ジャッジ時間 8,163 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 213 ms
89,180 KB
testcase_01 WA -
testcase_02 AC 209 ms
89,316 KB
testcase_03 AC 213 ms
89,324 KB
testcase_04 AC 206 ms
89,272 KB
testcase_05 AC 211 ms
89,180 KB
testcase_06 AC 204 ms
89,320 KB
testcase_07 AC 204 ms
89,248 KB
testcase_08 AC 207 ms
89,212 KB
testcase_09 AC 206 ms
89,232 KB
testcase_10 AC 212 ms
89,216 KB
testcase_11 AC 204 ms
89,396 KB
testcase_12 AC 216 ms
89,168 KB
testcase_13 AC 216 ms
89,336 KB
testcase_14 AC 214 ms
89,324 KB
testcase_15 AC 208 ms
89,324 KB
testcase_16 AC 208 ms
89,404 KB
testcase_17 AC 220 ms
89,184 KB
testcase_18 AC 222 ms
89,260 KB
testcase_19 AC 211 ms
89,368 KB
testcase_20 AC 205 ms
89,116 KB
testcase_21 AC 214 ms
89,396 KB
testcase_22 AC 210 ms
89,172 KB
testcase_23 AC 214 ms
89,200 KB
testcase_24 WA -
testcase_25 AC 208 ms
89,088 KB
testcase_26 AC 201 ms
89,352 KB
testcase_27 AC 209 ms
89,404 KB
testcase_28 AC 209 ms
89,272 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
if "." in X: print(Fraction(multiple_ten(X, d)) / Fraction(10 ** d))
else: print(X + "/" + "1")
0