結果

問題 No.1664 Unstable f(n)
ユーザー asumo0729asumo0729
提出日時 2021-09-05 16:37:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 531 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 87,080 KB
実行使用メモリ 72,160 KB
最終ジャッジ日時 2023-08-23 14:14:43
合計ジャッジ時間 5,395 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,768 KB
testcase_01 AC 75 ms
72,060 KB
testcase_02 AC 73 ms
71,664 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 74 ms
71,760 KB
testcase_07 AC 74 ms
71,636 KB
testcase_08 AC 75 ms
72,020 KB
testcase_09 AC 75 ms
72,160 KB
testcase_10 AC 75 ms
71,836 KB
testcase_11 AC 74 ms
71,760 KB
testcase_12 AC 73 ms
71,600 KB
testcase_13 AC 75 ms
71,696 KB
testcase_14 AC 73 ms
71,548 KB
testcase_15 AC 75 ms
72,120 KB
testcase_16 AC 74 ms
71,888 KB
testcase_17 AC 73 ms
71,968 KB
testcase_18 AC 74 ms
71,776 KB
testcase_19 AC 75 ms
71,936 KB
testcase_20 AC 75 ms
71,728 KB
testcase_21 AC 73 ms
72,116 KB
testcase_22 AC 75 ms
71,928 KB
testcase_23 AC 74 ms
71,892 KB
testcase_24 AC 74 ms
71,608 KB
testcase_25 AC 73 ms
72,140 KB
testcase_26 AC 74 ms
71,724 KB
testcase_27 AC 74 ms
71,800 KB
testcase_28 AC 73 ms
71,932 KB
testcase_29 AC 74 ms
71,728 KB
testcase_30 AC 75 ms
72,016 KB
testcase_31 AC 76 ms
71,812 KB
testcase_32 AC 75 ms
71,728 KB
testcase_33 AC 75 ms
71,736 KB
testcase_34 AC 74 ms
71,904 KB
testcase_35 AC 75 ms
71,968 KB
testcase_36 AC 75 ms
72,132 KB
testcase_37 AC 74 ms
71,976 KB
testcase_38 AC 75 ms
71,724 KB
testcase_39 AC 74 ms
72,064 KB
testcase_40 AC 74 ms
71,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from operator import itemgetter
import math
stdin=sys.stdin
sys.setrecursionlimit(10 ** 8)

ip=lambda: int(sp())
fp=lambda: float(sp())
lp=lambda:list(map(int,stdin.readline().split()))
sp=lambda:stdin.readline().rstrip()
Yp=lambda:print('Yes')
Np=lambda:print('No')
inf = 1 << 60
eps = 1e-9
sortkey = itemgetter(0)

n = ip()
ans = inf

for j in range(1,int(math.log2(n)) + 1):
    i = int(pow(n, (1.0 / j)))
    while pow(i,j) <= n:
        i += 1
    i -= 1
    k = n - i ** j
    ans = min(ans, i + j + k)

print(ans)
0