結果

問題 No.1664 Unstable f(n)
ユーザー ytft
提出日時 2022-03-23 04:13:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 196 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 82,256 KB
実行使用メモリ 54,756 KB
最終ジャッジ日時 2024-10-11 01:23:17
合計ジャッジ時間 3,426 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 31 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,math
input=lambda:sys.stdin.readline().rstrip()
n=int(input())
ans=n
p=1.0
while int(pow(n,1/p))>1:
	i=int(pow(n,1/p))
	j=int(math.log(n,i))
	ans=min(ans,i+j+n-i**j)
	p+=1.0
print(ans)
0