結果

問題 No.1664 Unstable f(n)
ユーザー ntuda
提出日時 2021-09-04 01:12:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 316 bytes
コンパイル時間 383 ms
コンパイル使用メモリ 82,452 KB
実行使用メモリ 71,820 KB
最終ジャッジ日時 2024-12-15 21:49:29
合計ジャッジ時間 3,784 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

def check(i,j):
    return N >= i ** j

N = int(input())
ans = 10 ** 18
for j in range(60):
    lb = 0
    ub = 10 ** 18
    while ub - lb > 1:
        mid = (ub + lb) // 2
        if check(mid,j):
            lb = mid
        else:
            ub = mid
    k = N - lb ** j
    ans = min(ans, j + lb + k)
print(ans)
0