結果

問題 No.1464 Number Conversion
ユーザー ああいい
提出日時 2021-12-27 15:34:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-09-25 09:06:19
合計ジャッジ時間 2,008 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import Decimal

X = Decimal(input())
S = int(X * 10 ** 8)
B = 10 ** 8

import sys
if S == 0:
    print(0,"/",1,sep = "")
    exit()

def gcd(a,b):
    while True:
        r = a % b
        a = b
        b = r
        if r == 0:
            return a
d = gcd(S,B)
print(S // d,'/',B // d,sep = "")
0