結果

問題 No.1464 Number Conversion
ユーザー Super SolenoidSuper Solenoid
提出日時 2021-05-19 15:05:47
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2024-04-18 01:23:59
合計ジャッジ時間 2,547 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
51,840 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 39 ms
52,352 KB
testcase_03 AC 36 ms
51,712 KB
testcase_04 AC 36 ms
51,968 KB
testcase_05 AC 36 ms
51,840 KB
testcase_06 AC 36 ms
52,196 KB
testcase_07 AC 37 ms
51,968 KB
testcase_08 AC 35 ms
51,840 KB
testcase_09 WA -
testcase_10 AC 34 ms
51,712 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 35 ms
51,712 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 36 ms
51,456 KB
testcase_23 AC 35 ms
51,456 KB
testcase_24 AC 34 ms
52,224 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 34 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = float(input())

m = [n , 1]
n_s = format(m[0], '.8f')

for i in range(8):
    if int(n_s[-(i + 1)]) == 0:
        continue
    k = 10 / int(n_s[-(i + 1)])
    if not isinstance(k, int):
        k = 10
    m = [k * m[0], k * m[1]]
    n_s = format(m[0], '.8f')

print(str(int(m[0])) + '/' + str(m[1]))
0