結果

問題 No.1176 少ない質問
ユーザー miya145592miya145592
提出日時 2023-05-16 00:00:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 1,000 ms
コード長 321 bytes
コンパイル時間 456 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 54,584 KB
最終ジャッジ日時 2024-05-08 04:26:47
合計ジャッジ時間 2,137 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,072 KB
testcase_01 AC 37 ms
54,584 KB
testcase_02 AC 35 ms
53,680 KB
testcase_03 AC 34 ms
53,132 KB
testcase_04 AC 35 ms
53,528 KB
testcase_05 AC 38 ms
54,196 KB
testcase_06 AC 36 ms
53,692 KB
testcase_07 AC 34 ms
53,136 KB
testcase_08 AC 35 ms
52,964 KB
testcase_09 AC 36 ms
52,732 KB
testcase_10 AC 37 ms
53,728 KB
testcase_11 AC 37 ms
53,792 KB
testcase_12 AC 36 ms
53,080 KB
testcase_13 AC 34 ms
52,496 KB
testcase_14 AC 34 ms
53,348 KB
testcase_15 AC 36 ms
53,920 KB
testcase_16 AC 35 ms
53,200 KB
testcase_17 AC 36 ms
53,916 KB
testcase_18 AC 37 ms
54,080 KB
testcase_19 AC 37 ms
53,116 KB
testcase_20 AC 38 ms
52,488 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
A = int(input())
if A<=6:
    print(A)
else:
    v = int(math.log(A, 2))
    w = int(math.log(A, 3))
    for v in range(v, v+10000):
        if 2**v>=A:
            ans = 2*v
            break
    for w in range(w, w+10000):
        if 3**w>=A:
            ans = min(ans, 3*w)
            break
    print(ans)
0