結果

問題 No.1664 Unstable f(n)
ユーザー brthyyjpbrthyyjp
提出日時 2021-09-04 09:24:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 315 bytes
コンパイル時間 593 ms
コンパイル使用メモリ 86,840 KB
実行使用メモリ 71,924 KB
最終ジャッジ日時 2023-08-22 16:02:37
合計ジャッジ時間 5,056 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,828 KB
testcase_01 AC 72 ms
71,544 KB
testcase_02 AC 73 ms
71,488 KB
testcase_03 AC 72 ms
71,012 KB
testcase_04 AC 73 ms
71,072 KB
testcase_05 AC 74 ms
71,188 KB
testcase_06 AC 73 ms
71,724 KB
testcase_07 AC 73 ms
71,660 KB
testcase_08 AC 72 ms
71,548 KB
testcase_09 AC 71 ms
71,820 KB
testcase_10 AC 72 ms
71,584 KB
testcase_11 AC 71 ms
71,868 KB
testcase_12 AC 73 ms
71,740 KB
testcase_13 AC 72 ms
71,624 KB
testcase_14 AC 71 ms
71,828 KB
testcase_15 AC 73 ms
71,500 KB
testcase_16 AC 72 ms
71,648 KB
testcase_17 AC 72 ms
71,628 KB
testcase_18 AC 72 ms
71,516 KB
testcase_19 AC 72 ms
71,548 KB
testcase_20 AC 73 ms
71,420 KB
testcase_21 AC 72 ms
71,408 KB
testcase_22 AC 73 ms
71,724 KB
testcase_23 AC 70 ms
71,544 KB
testcase_24 AC 71 ms
71,592 KB
testcase_25 AC 70 ms
71,672 KB
testcase_26 AC 70 ms
71,620 KB
testcase_27 AC 70 ms
71,624 KB
testcase_28 AC 70 ms
71,740 KB
testcase_29 AC 71 ms
71,548 KB
testcase_30 AC 70 ms
71,440 KB
testcase_31 AC 70 ms
71,676 KB
testcase_32 AC 71 ms
71,788 KB
testcase_33 AC 70 ms
71,444 KB
testcase_34 AC 72 ms
71,800 KB
testcase_35 AC 71 ms
71,772 KB
testcase_36 AC 71 ms
71,672 KB
testcase_37 AC 71 ms
71,772 KB
testcase_38 AC 72 ms
71,660 KB
testcase_39 AC 72 ms
71,772 KB
testcase_40 AC 72 ms
71,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
if n == 1:
    print(1)
    exit()
if n == 2:
    print(2)
    exit()
if n == 3:
    print(3)
    exit()
import math
res = float('inf')
for j in range(2, int(math.log2(n)+2)):
    i = int(n**(1/j))
    while pow(i+1, j) <= n:
        i += 1
    k = n-pow(i, j)
    res = min(res, i+j+k)
print(res)
0