結果

問題 No.1664 Unstable f(n)
ユーザー tktk_snsn
提出日時 2021-09-03 21:54:09
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 223 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 21,376 KB
最終ジャッジ日時 2024-12-15 12:50:08
合計ジャッジ時間 45,502 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24 TLE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

ans = 1 + 0 + (n - 1)

j = 10 ** 18
i = 2
while j != 1 and i <= n:
    j = 1
    x = i
    while x * i <= n:
        x *= i
        j += 1
    k = n - x
    ans = min(ans, i + j + k)
    i += 1

print(ans)
0