結果

問題 No.1464 Number Conversion
ユーザー 👑 Kazun
提出日時 2021-04-02 21:33:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,608 KB
最終ジャッジ日時 2024-12-23 18:26:58
合計ジャッジ時間 2,462 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

def Decimal_to_Int(s:str,k:int,base=10) -> int:
    """

    s:小数点を含むかもしれない数
    k:小数点以下高々何位までか?
    base:基数
    """

    if "." not in s:
        return int(s,base)*pow(base,k)

    m=s.index(".")
    return int(s.replace(".",""))*pow(base,k-(len(s)-m-1))
#================================================
from math import gcd

S=input()
Y=Decimal_to_Int(S,8)

g=gcd(Y,10**8)
print("{}/{}".format(Y//g,10**8//g))
0