結果

問題 No.1464 Number Conversion
ユーザー 👑 rin204
提出日時 2022-01-18 04:20:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,412 KB
実行使用メモリ 53,912 KB
最終ジャッジ日時 2024-11-23 13:14:22
合計ジャッジ時間 2,550 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd

S = input()
if "." not in S:
    print(f"{S}/1")
    exit()

x, y = S.split(".")
l = len(y)
d = 10 ** l
x = int(x) * d + int(y)
g = gcd(x, d)
x //= g
d //= g
print(f"{x}/{d}")
0