結果

問題 No.1664 Unstable f(n)
ユーザー shakayamishakayami
提出日時 2021-09-03 21:32:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 250 ms
コンパイル使用メモリ 82,348 KB
実行使用メモリ 53,916 KB
最終ジャッジ日時 2024-05-09 02:02:54
合計ジャッジ時間 3,042 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
52,336 KB
testcase_01 AC 38 ms
53,588 KB
testcase_02 AC 36 ms
52,804 KB
testcase_03 AC 37 ms
52,092 KB
testcase_04 AC 37 ms
51,816 KB
testcase_05 AC 38 ms
52,424 KB
testcase_06 AC 37 ms
52,140 KB
testcase_07 AC 42 ms
52,392 KB
testcase_08 AC 37 ms
52,116 KB
testcase_09 AC 38 ms
52,388 KB
testcase_10 AC 38 ms
52,368 KB
testcase_11 AC 38 ms
53,100 KB
testcase_12 AC 39 ms
53,360 KB
testcase_13 AC 37 ms
52,472 KB
testcase_14 AC 37 ms
52,404 KB
testcase_15 AC 37 ms
53,680 KB
testcase_16 AC 38 ms
53,532 KB
testcase_17 AC 38 ms
52,724 KB
testcase_18 AC 38 ms
53,556 KB
testcase_19 AC 37 ms
52,532 KB
testcase_20 AC 37 ms
52,960 KB
testcase_21 AC 38 ms
53,368 KB
testcase_22 AC 37 ms
52,832 KB
testcase_23 AC 38 ms
53,560 KB
testcase_24 AC 37 ms
52,068 KB
testcase_25 AC 38 ms
53,916 KB
testcase_26 AC 38 ms
52,272 KB
testcase_27 AC 37 ms
53,284 KB
testcase_28 AC 38 ms
52,484 KB
testcase_29 AC 37 ms
52,628 KB
testcase_30 AC 37 ms
52,960 KB
testcase_31 AC 37 ms
52,740 KB
testcase_32 AC 37 ms
52,708 KB
testcase_33 AC 37 ms
53,188 KB
testcase_34 AC 38 ms
52,196 KB
testcase_35 AC 38 ms
52,400 KB
testcase_36 AC 37 ms
53,460 KB
testcase_37 AC 37 ms
52,708 KB
testcase_38 AC 37 ms
52,604 KB
testcase_39 AC 39 ms
52,356 KB
testcase_40 AC 37 ms
52,140 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
'''

i=1のとき
(i,j,k)=(1,j,N-1)
'''
ans=N
j=1
while(2**j<=N):
    low=2
    high=2
    while(high**j<=N):
        high*=2
    while(high-low>1):
        mid=(high+low)//2
        if mid**j<=N:
            low=mid
        else:
            high=mid
    i=low
    k=N-i**j
    ans=min(ans,i+j+k)
    j+=1
print(ans)
0