結果

問題 No.1664 Unstable f(n)
ユーザー asumo0729asumo0729
提出日時 2021-09-05 16:39:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 529 bytes
コンパイル時間 299 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 72,208 KB
最終ジャッジ日時 2023-08-23 14:15:00
合計ジャッジ時間 4,931 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,736 KB
testcase_01 AC 76 ms
72,020 KB
testcase_02 AC 76 ms
71,848 KB
testcase_03 AC 76 ms
71,476 KB
testcase_04 AC 75 ms
71,556 KB
testcase_05 AC 75 ms
71,356 KB
testcase_06 AC 76 ms
71,872 KB
testcase_07 AC 75 ms
71,804 KB
testcase_08 AC 75 ms
71,980 KB
testcase_09 AC 75 ms
71,728 KB
testcase_10 AC 76 ms
71,808 KB
testcase_11 AC 75 ms
71,852 KB
testcase_12 AC 76 ms
71,888 KB
testcase_13 AC 76 ms
71,600 KB
testcase_14 AC 76 ms
71,600 KB
testcase_15 AC 75 ms
71,928 KB
testcase_16 AC 75 ms
71,804 KB
testcase_17 AC 74 ms
72,020 KB
testcase_18 AC 74 ms
71,824 KB
testcase_19 AC 74 ms
71,652 KB
testcase_20 AC 74 ms
71,988 KB
testcase_21 AC 75 ms
71,732 KB
testcase_22 AC 73 ms
71,836 KB
testcase_23 AC 76 ms
71,600 KB
testcase_24 AC 74 ms
71,724 KB
testcase_25 AC 77 ms
71,800 KB
testcase_26 AC 77 ms
71,816 KB
testcase_27 AC 75 ms
72,124 KB
testcase_28 AC 76 ms
71,936 KB
testcase_29 AC 74 ms
71,920 KB
testcase_30 AC 75 ms
72,120 KB
testcase_31 AC 75 ms
71,920 KB
testcase_32 AC 76 ms
72,208 KB
testcase_33 AC 77 ms
71,936 KB
testcase_34 AC 75 ms
71,800 KB
testcase_35 AC 76 ms
71,796 KB
testcase_36 AC 76 ms
71,844 KB
testcase_37 AC 77 ms
71,968 KB
testcase_38 AC 74 ms
71,724 KB
testcase_39 AC 76 ms
71,880 KB
testcase_40 AC 75 ms
71,648 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 = n

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