結果

問題 No.1464 Number Conversion
ユーザー brthyyjpbrthyyjp
提出日時 2021-04-02 21:41:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 284 bytes
コンパイル時間 560 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 71,768 KB
最終ジャッジ日時 2023-08-25 11:52:07
合計ジャッジ時間 3,863 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,304 KB
testcase_01 AC 72 ms
71,476 KB
testcase_02 AC 70 ms
71,472 KB
testcase_03 AC 71 ms
71,136 KB
testcase_04 AC 72 ms
71,440 KB
testcase_05 AC 71 ms
71,704 KB
testcase_06 AC 72 ms
71,440 KB
testcase_07 AC 72 ms
71,572 KB
testcase_08 AC 70 ms
71,748 KB
testcase_09 AC 72 ms
71,712 KB
testcase_10 AC 70 ms
71,584 KB
testcase_11 AC 71 ms
71,752 KB
testcase_12 AC 72 ms
71,508 KB
testcase_13 AC 72 ms
71,768 KB
testcase_14 AC 70 ms
71,376 KB
testcase_15 AC 71 ms
71,512 KB
testcase_16 AC 69 ms
71,468 KB
testcase_17 AC 71 ms
71,380 KB
testcase_18 AC 71 ms
71,412 KB
testcase_19 AC 70 ms
71,604 KB
testcase_20 AC 71 ms
71,568 KB
testcase_21 AC 71 ms
71,344 KB
testcase_22 AC 70 ms
71,556 KB
testcase_23 AC 71 ms
71,340 KB
testcase_24 AC 69 ms
71,748 KB
testcase_25 AC 68 ms
71,364 KB
testcase_26 AC 70 ms
71,700 KB
testcase_27 AC 70 ms
71,176 KB
testcase_28 AC 71 ms
71,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

X = list(map(str, input().split('.')))
import math
if len(X) == 2:
    a, b = X[0], X[1]
    b = b+'0'*(8-len(b))
    a = int(a)
    b = int(b)
    a *= 10**8

    g = math.gcd(a+b, 10**8)
    s = (a+b)//g
    B = (10**8)//g
    print(str(s)+'/'+str(B))
else:
    print(X[0]+'/'+'1')
0