結果

問題 No.1664 Unstable f(n)
ユーザー ntudantuda
提出日時 2021-09-04 01:12:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 316 bytes
コンパイル時間 470 ms
コンパイル使用メモリ 87,332 KB
実行使用メモリ 76,132 KB
最終ジャッジ日時 2023-08-22 04:00:57
合計ジャッジ時間 5,748 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
75,916 KB
testcase_01 AC 86 ms
76,048 KB
testcase_02 AC 85 ms
75,908 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 81 ms
75,992 KB
testcase_07 AC 83 ms
76,008 KB
testcase_08 AC 83 ms
75,864 KB
testcase_09 AC 82 ms
75,860 KB
testcase_10 AC 81 ms
75,984 KB
testcase_11 AC 81 ms
76,132 KB
testcase_12 AC 85 ms
75,708 KB
testcase_13 AC 84 ms
75,996 KB
testcase_14 AC 85 ms
75,952 KB
testcase_15 AC 84 ms
75,984 KB
testcase_16 AC 83 ms
75,900 KB
testcase_17 AC 83 ms
75,992 KB
testcase_18 AC 82 ms
76,088 KB
testcase_19 AC 82 ms
75,996 KB
testcase_20 AC 82 ms
75,968 KB
testcase_21 AC 83 ms
75,992 KB
testcase_22 AC 83 ms
75,680 KB
testcase_23 AC 82 ms
76,048 KB
testcase_24 AC 83 ms
75,996 KB
testcase_25 AC 83 ms
75,892 KB
testcase_26 AC 82 ms
75,952 KB
testcase_27 AC 84 ms
75,868 KB
testcase_28 AC 82 ms
76,052 KB
testcase_29 AC 83 ms
75,864 KB
testcase_30 AC 82 ms
76,008 KB
testcase_31 AC 83 ms
75,996 KB
testcase_32 AC 81 ms
75,680 KB
testcase_33 AC 83 ms
75,684 KB
testcase_34 AC 83 ms
75,876 KB
testcase_35 AC 83 ms
75,912 KB
testcase_36 AC 82 ms
75,700 KB
testcase_37 AC 82 ms
75,968 KB
testcase_38 AC 83 ms
75,856 KB
testcase_39 AC 82 ms
76,124 KB
testcase_40 AC 83 ms
75,948 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i,j):
    return N >= i ** j

N = int(input())
ans = 10 ** 18
for j in range(60):
    lb = 0
    ub = 10 ** 18
    while ub - lb > 1:
        mid = (ub + lb) // 2
        if check(mid,j):
            lb = mid
        else:
            ub = mid
    k = N - lb ** j
    ans = min(ans, j + lb + k)
print(ans)
0