結果

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

ソースコード

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))
    k = n-pow(i, j)
    res = min(res, i+j+k)
print(res)
0