結果

問題 No.1664 Unstable f(n)
ユーザー shakayamishakayami
提出日時 2021-09-03 21:30:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 394 bytes
コンパイル時間 208 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-05-09 01:53:32
合計ジャッジ時間 3,178 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
51,712 KB
testcase_01 AC 42 ms
51,968 KB
testcase_02 AC 42 ms
51,712 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 42 ms
51,584 KB
testcase_11 AC 42 ms
51,584 KB
testcase_12 AC 42 ms
52,096 KB
testcase_13 AC 42 ms
51,968 KB
testcase_14 AC 43 ms
51,840 KB
testcase_15 AC 48 ms
51,968 KB
testcase_16 AC 48 ms
51,968 KB
testcase_17 AC 47 ms
52,096 KB
testcase_18 AC 47 ms
51,840 KB
testcase_19 AC 48 ms
52,096 KB
testcase_20 AC 47 ms
51,840 KB
testcase_21 AC 47 ms
51,840 KB
testcase_22 AC 46 ms
51,840 KB
testcase_23 AC 47 ms
51,840 KB
testcase_24 AC 46 ms
51,712 KB
testcase_25 AC 42 ms
52,224 KB
testcase_26 AC 41 ms
51,584 KB
testcase_27 AC 43 ms
51,584 KB
testcase_28 AC 42 ms
51,584 KB
testcase_29 AC 41 ms
51,840 KB
testcase_30 AC 41 ms
51,584 KB
testcase_31 AC 41 ms
51,968 KB
testcase_32 AC 43 ms
51,840 KB
testcase_33 AC 42 ms
51,584 KB
testcase_34 AC 42 ms
51,712 KB
testcase_35 AC 42 ms
51,840 KB
testcase_36 AC 42 ms
51,712 KB
testcase_37 AC 42 ms
51,968 KB
testcase_38 AC 42 ms
52,096 KB
testcase_39 AC 41 ms
51,840 KB
testcase_40 AC 42 ms
51,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
'''
j=0のとき
(i,j,k)=(0,0,N-1)
i=0のとき
(i,j,k)=(0,j,N)
i=1のとき
(i,j,k)=(1,j,N-1)
'''
ans=N-1
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