結果

問題 No.1464 Number Conversion
コンテスト
ユーザー aaaaaaaaaa2230
提出日時 2021-04-02 22:03:30
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 25 ms / 2,000 ms
+ 481µs
コード長 255 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 70 ms
コンパイル使用メモリ 81,896 KB
実行使用メモリ 56,076 KB
最終ジャッジ日時 2026-10-06 17:16:22
合計ジャッジ時間 2,603 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 29
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math
x = input()

s = 0
check = False
b = 1
for i in range(len(x)):
    if x[i] == ".":
        check = True
        b = 10**(len(x)-i-1)
        continue
    s *= 10
    s += int(x[i])


g = math.gcd(s,b)
s //= g
b //= g
print("{}/{}".format(s,b))
0