結果

問題 No.1464 Number Conversion
ユーザー Kiri8128Kiri8128
提出日時 2021-04-02 21:32:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-23 18:26:32
合計ジャッジ時間 1,936 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

def x10(st, n=4):
    if st[0] == "-": return -x10(st[1:], n)
    if "." not in st: return int(st) * 10 ** n
    a = st.find(".")
    return int(st[:a]) * 10 ** n + int("0" + st[a+1:]) * 10 ** (n - len(st) + a + 1)

def gcd(a, b):
    while b: a, b = b, a % b
    return a

a = x10(input(), 8)
b = 10 ** 8
g = gcd(a, b)
print(str(a // g) + "/" + str(b // g))
0