結果

問題 No.1176 少ない質問
ユーザー miya145592miya145592
提出日時 2023-05-16 00:00:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 1,000 ms
コード長 321 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 71,700 KB
最終ジャッジ日時 2023-08-20 22:16:37
合計ジャッジ時間 3,485 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,488 KB
testcase_01 AC 78 ms
71,460 KB
testcase_02 AC 75 ms
71,280 KB
testcase_03 AC 73 ms
71,432 KB
testcase_04 AC 75 ms
71,272 KB
testcase_05 AC 74 ms
71,444 KB
testcase_06 AC 74 ms
71,300 KB
testcase_07 AC 76 ms
71,376 KB
testcase_08 AC 74 ms
71,672 KB
testcase_09 AC 73 ms
71,388 KB
testcase_10 AC 77 ms
71,392 KB
testcase_11 AC 75 ms
71,304 KB
testcase_12 AC 74 ms
71,384 KB
testcase_13 AC 76 ms
71,272 KB
testcase_14 AC 76 ms
71,700 KB
testcase_15 AC 75 ms
71,456 KB
testcase_16 AC 75 ms
71,304 KB
testcase_17 AC 77 ms
71,392 KB
testcase_18 AC 75 ms
71,380 KB
testcase_19 AC 75 ms
71,484 KB
testcase_20 AC 76 ms
71,480 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