結果

問題 No.1664 Unstable f(n)
ユーザー brthyyjp
提出日時 2021-09-04 09:22:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 245 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 54,408 KB
最終ジャッジ日時 2024-12-17 15:52:08
合計ジャッジ時間 2,955 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
if n == 1:
    print(1)
    exit()
import math
res = float('inf')
for j in range(2, int(math.log2(n)+1)):
    i = int(n**(1/j))
    while pow(i+1, j) <= n:
        i += 1
    k = n-pow(i, j)
    res = min(res, i+j+k)
print(res)
0