結果

問題 No.1464 Number Conversion
ユーザー 👑 tamatotamato
提出日時 2021-04-02 21:31:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 430 bytes
コンパイル時間 759 ms
コンパイル使用メモリ 87,512 KB
実行使用メモリ 72,160 KB
最終ジャッジ日時 2023-08-25 11:32:42
合計ジャッジ時間 3,553 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,872 KB
testcase_01 AC 72 ms
71,856 KB
testcase_02 AC 71 ms
72,056 KB
testcase_03 AC 71 ms
72,072 KB
testcase_04 AC 69 ms
71,776 KB
testcase_05 AC 70 ms
71,788 KB
testcase_06 AC 69 ms
71,952 KB
testcase_07 AC 68 ms
71,900 KB
testcase_08 AC 69 ms
71,852 KB
testcase_09 AC 70 ms
71,856 KB
testcase_10 AC 69 ms
71,692 KB
testcase_11 AC 69 ms
72,060 KB
testcase_12 AC 68 ms
71,776 KB
testcase_13 AC 67 ms
72,060 KB
testcase_14 AC 68 ms
71,728 KB
testcase_15 AC 70 ms
72,160 KB
testcase_16 AC 69 ms
71,904 KB
testcase_17 AC 69 ms
72,144 KB
testcase_18 AC 70 ms
71,860 KB
testcase_19 AC 69 ms
71,692 KB
testcase_20 AC 69 ms
71,908 KB
testcase_21 AC 69 ms
71,608 KB
testcase_22 AC 67 ms
71,556 KB
testcase_23 AC 67 ms
71,784 KB
testcase_24 AC 71 ms
71,696 KB
testcase_25 AC 68 ms
72,160 KB
testcase_26 AC 70 ms
71,988 KB
testcase_27 AC 68 ms
71,784 KB
testcase_28 AC 69 ms
71,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    from math import gcd
    input = sys.stdin.readline

    S = input().rstrip('\n')
    if "." not in S:
        print(S + "/1")
    else:
        x, y = S.split(".")
        L = len(y)
        x = int(x)
        y = int(y)
        g = gcd(10**L, x * 10**L + y)
        print(str((x * 10**L + y) // g) + "/" + str((10**L) // g))


if __name__ == '__main__':
    main()
0