結果

問題 No.1664 Unstable f(n)
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-09-03 21:34:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 85 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 297 ms
コンパイル使用メモリ 86,840 KB
実行使用メモリ 76,412 KB
最終ジャッジ日時 2023-08-21 20:07:55
合計ジャッジ時間 5,255 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
76,232 KB
testcase_01 AC 82 ms
76,184 KB
testcase_02 AC 81 ms
76,120 KB
testcase_03 AC 83 ms
76,348 KB
testcase_04 AC 82 ms
76,324 KB
testcase_05 AC 83 ms
76,116 KB
testcase_06 AC 83 ms
76,376 KB
testcase_07 AC 82 ms
76,284 KB
testcase_08 AC 81 ms
76,160 KB
testcase_09 AC 83 ms
76,260 KB
testcase_10 AC 83 ms
76,412 KB
testcase_11 AC 83 ms
75,996 KB
testcase_12 AC 83 ms
76,156 KB
testcase_13 AC 85 ms
76,272 KB
testcase_14 AC 81 ms
76,148 KB
testcase_15 AC 82 ms
76,272 KB
testcase_16 AC 83 ms
76,264 KB
testcase_17 AC 82 ms
76,176 KB
testcase_18 AC 83 ms
76,232 KB
testcase_19 AC 83 ms
76,192 KB
testcase_20 AC 83 ms
76,000 KB
testcase_21 AC 84 ms
76,100 KB
testcase_22 AC 84 ms
76,112 KB
testcase_23 AC 84 ms
76,000 KB
testcase_24 AC 82 ms
76,216 KB
testcase_25 AC 81 ms
76,168 KB
testcase_26 AC 83 ms
76,148 KB
testcase_27 AC 81 ms
76,040 KB
testcase_28 AC 82 ms
76,104 KB
testcase_29 AC 83 ms
75,964 KB
testcase_30 AC 81 ms
76,168 KB
testcase_31 AC 82 ms
76,212 KB
testcase_32 AC 82 ms
76,172 KB
testcase_33 AC 82 ms
76,292 KB
testcase_34 AC 82 ms
76,228 KB
testcase_35 AC 83 ms
76,128 KB
testcase_36 AC 83 ms
76,320 KB
testcase_37 AC 83 ms
76,252 KB
testcase_38 AC 83 ms
76,104 KB
testcase_39 AC 84 ms
76,120 KB
testcase_40 AC 83 ms
76,148 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ans=10**19
for j in range(1,65):
    ok=0
    ng=10**18
    while ng-ok>1:
        mid=(ok+ng)//2
        if mid**j<=n:ok=mid
        else:ng=mid

    i=ok

    k=n-i**j
    ans=min(ans,i+j+k)

i=1
j=0
k=n-1
ans=min(ans,i+j+k)
print(ans)
0