結果

問題 No.1664 Unstable f(n)
ユーザー flippergo
提出日時 2024-10-27 23:42:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 410 ms
コンパイル使用メモリ 82,132 KB
実行使用メモリ 71,500 KB
最終ジャッジ日時 2024-10-27 23:42:50
合計ジャッジ時間 3,826 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = N
for j in range(60+1):
    high = N
    low = 1
    while high-low>1:
        mid = (high+low)//2
        if pow(mid,j)<=N:
            low = mid
        else:
            high = mid
    ans = min(ans,low+j+N-pow(low,j))
print(ans)
0