結果
| 問題 |
No.1664 Unstable f(n)
|
| コンテスト | |
| ユーザー |
sapphire__15
|
| 提出日時 | 2021-09-03 21:50:08 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 30 ms / 2,000 ms |
| コード長 | 617 bytes |
| コンパイル時間 | 483 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-12-15 12:18:37 |
| 合計ジャッジ時間 | 2,587 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
import math
def Next(): return input()
def NextInt(): return int(Next())
def NextInts(): return map(int,input().split())
def Nexts(): return map(str,input().split())
def NextIntList(): return list(map(int,input().split()))
def RowInts(n): return [int(input()) for i in range(n)]
def cal(n, x):
y = int(math.pow(n, 1/x))
ok, ng = 0, y*2
while ng - ok > 1:
now =(ng+ok)//2
if now**x > n:
ng = now
else:
ok = now
return ok + x + (n-ok**x)
n = int(input())
ans = n
for i in range(2, 63):
now = cal(n, i)
if now < ans:
ans = now
print(ans)
sapphire__15