結果

問題 No.1664 Unstable f(n)
ユーザー rlangevinrlangevin
提出日時 2022-12-31 19:53:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 365 bytes
コンパイル時間 333 ms
コンパイル使用メモリ 86,904 KB
実行使用メモリ 76,312 KB
最終ジャッジ日時 2023-08-17 19:32:52
合計ジャッジ時間 5,633 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
75,512 KB
testcase_01 AC 84 ms
75,292 KB
testcase_02 AC 83 ms
75,512 KB
testcase_03 AC 81 ms
75,396 KB
testcase_04 AC 82 ms
75,588 KB
testcase_05 AC 85 ms
75,288 KB
testcase_06 AC 85 ms
75,412 KB
testcase_07 AC 84 ms
75,468 KB
testcase_08 AC 84 ms
75,288 KB
testcase_09 AC 84 ms
75,560 KB
testcase_10 AC 84 ms
75,424 KB
testcase_11 AC 86 ms
76,168 KB
testcase_12 AC 84 ms
76,020 KB
testcase_13 AC 85 ms
75,888 KB
testcase_14 AC 87 ms
76,016 KB
testcase_15 AC 86 ms
75,820 KB
testcase_16 AC 84 ms
75,924 KB
testcase_17 AC 86 ms
76,020 KB
testcase_18 AC 85 ms
76,312 KB
testcase_19 AC 87 ms
76,012 KB
testcase_20 AC 85 ms
76,016 KB
testcase_21 AC 82 ms
75,756 KB
testcase_22 AC 82 ms
75,288 KB
testcase_23 AC 84 ms
75,292 KB
testcase_24 AC 83 ms
75,412 KB
testcase_25 AC 83 ms
75,380 KB
testcase_26 AC 82 ms
75,452 KB
testcase_27 AC 84 ms
75,448 KB
testcase_28 AC 82 ms
75,404 KB
testcase_29 AC 84 ms
75,424 KB
testcase_30 AC 83 ms
75,452 KB
testcase_31 AC 79 ms
75,404 KB
testcase_32 AC 82 ms
76,008 KB
testcase_33 AC 84 ms
75,344 KB
testcase_34 AC 86 ms
75,452 KB
testcase_35 AC 87 ms
75,928 KB
testcase_36 AC 84 ms
75,540 KB
testcase_37 AC 87 ms
76,068 KB
testcase_38 AC 84 ms
75,508 KB
testcase_39 AC 85 ms
75,892 KB
testcase_40 AC 83 ms
75,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def calc(N, j):
    yes = 1
    no = 10 ** 18 + 1
    if j == 0:
        return 1
    while no - yes != 1:
        mid = (yes + no)//2
        if mid ** j <= N:
            yes = mid
        else:
            no = mid
    return yes


N = int(input())
ans = 10 ** 20
for j in range(65):
    i = calc(N, j)
    k = N - i ** j
    ans = min(ans, i + j + k)
print(ans)
0