結果
| 問題 | No.1664 Unstable f(n) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-09-03 21:33:39 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 2,000 ms |
| コード長 | 190 bytes |
| 記録 | |
| コンパイル時間 | 1,335 ms |
| コンパイル使用メモリ | 81,848 KB |
| 実行使用メモリ | 53,824 KB |
| 最終ジャッジ日時 | 2024-12-15 10:31:39 |
| 合計ジャッジ時間 | 3,492 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
n = int(input())
ans = n
for j in range(2, 61):
x = int(n ** (1 / j))
x -= 2
while pow(x, j) <= n:
x += 1
x -= 1
ans = min(ans, x + j + n - pow(x, j))
print(ans)