結果

問題 No.1464 Number Conversion
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2021-04-02 22:03:30
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 494 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 71,748 KB
最終ジャッジ日時 2023-08-25 12:16:29
合計ジャッジ時間 3,900 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,508 KB
testcase_01 AC 67 ms
71,748 KB
testcase_02 AC 67 ms
71,408 KB
testcase_03 AC 67 ms
71,172 KB
testcase_04 AC 68 ms
71,524 KB
testcase_05 AC 66 ms
71,644 KB
testcase_06 AC 68 ms
71,496 KB
testcase_07 AC 69 ms
71,716 KB
testcase_08 AC 67 ms
71,704 KB
testcase_09 AC 68 ms
71,476 KB
testcase_10 AC 69 ms
71,320 KB
testcase_11 AC 68 ms
71,640 KB
testcase_12 AC 68 ms
71,268 KB
testcase_13 AC 68 ms
71,260 KB
testcase_14 AC 71 ms
71,460 KB
testcase_15 AC 68 ms
71,288 KB
testcase_16 AC 66 ms
71,220 KB
testcase_17 AC 67 ms
71,468 KB
testcase_18 AC 69 ms
71,264 KB
testcase_19 AC 69 ms
71,364 KB
testcase_20 AC 68 ms
71,376 KB
testcase_21 AC 68 ms
71,396 KB
testcase_22 AC 67 ms
71,120 KB
testcase_23 AC 68 ms
71,728 KB
testcase_24 AC 68 ms
71,740 KB
testcase_25 AC 70 ms
71,392 KB
testcase_26 AC 70 ms
71,744 KB
testcase_27 AC 70 ms
71,472 KB
testcase_28 AC 72 ms
71,392 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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