結果

問題 No.1664 Unstable f(n)
ユーザー taiga0629kyoprotaiga0629kyopro
提出日時 2021-09-03 21:34:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 72,716 KB
最終ジャッジ日時 2024-05-09 02:10:59
合計ジャッジ時間 3,493 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
71,176 KB
testcase_01 AC 48 ms
71,132 KB
testcase_02 AC 48 ms
71,024 KB
testcase_03 AC 47 ms
72,148 KB
testcase_04 AC 47 ms
71,000 KB
testcase_05 AC 46 ms
71,328 KB
testcase_06 AC 47 ms
71,528 KB
testcase_07 AC 46 ms
71,456 KB
testcase_08 AC 46 ms
70,704 KB
testcase_09 AC 47 ms
71,892 KB
testcase_10 AC 46 ms
71,964 KB
testcase_11 AC 46 ms
72,060 KB
testcase_12 AC 50 ms
71,660 KB
testcase_13 AC 46 ms
71,776 KB
testcase_14 AC 46 ms
71,140 KB
testcase_15 AC 51 ms
70,884 KB
testcase_16 AC 45 ms
71,576 KB
testcase_17 AC 46 ms
70,484 KB
testcase_18 AC 48 ms
71,352 KB
testcase_19 AC 46 ms
71,464 KB
testcase_20 AC 46 ms
71,100 KB
testcase_21 AC 46 ms
70,880 KB
testcase_22 AC 47 ms
71,260 KB
testcase_23 AC 46 ms
70,756 KB
testcase_24 AC 47 ms
71,716 KB
testcase_25 AC 47 ms
72,716 KB
testcase_26 AC 46 ms
72,204 KB
testcase_27 AC 47 ms
70,728 KB
testcase_28 AC 51 ms
72,112 KB
testcase_29 AC 47 ms
72,296 KB
testcase_30 AC 47 ms
71,664 KB
testcase_31 AC 47 ms
70,980 KB
testcase_32 AC 46 ms
70,872 KB
testcase_33 AC 46 ms
71,876 KB
testcase_34 AC 46 ms
70,856 KB
testcase_35 AC 45 ms
71,100 KB
testcase_36 AC 45 ms
71,420 KB
testcase_37 AC 46 ms
71,468 KB
testcase_38 AC 45 ms
71,556 KB
testcase_39 AC 45 ms
70,896 KB
testcase_40 AC 47 ms
70,692 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