結果

問題 No.1464 Number Conversion
ユーザー DrDrpilot
提出日時 2022-05-12 16:26:52
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 36 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-20 10:11:53
合計ジャッジ時間 2,089 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

x=input()
if '.' not in x:
    print(x+'/'+'1')
else:
    i=len(x)-x.index('.')-1
    x=int(x.replace('.',''))
    y=pow(10,i)
    from math import gcd
    num=gcd(x,y)
    print(str(x//num)+'/'+str(y//num))
0