結果

問題 No.1664 Unstable f(n)
ユーザー kimiyukikimiyuki
提出日時 2021-09-03 22:42:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 1,004 ms
コンパイル使用メモリ 10,628 KB
実行使用メモリ 8,096 KB
最終ジャッジ日時 2023-08-21 23:43:20
合計ジャッジ時間 2,515 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,896 KB
testcase_01 AC 16 ms
7,832 KB
testcase_02 AC 15 ms
8,056 KB
testcase_03 AC 15 ms
7,920 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 15 ms
7,944 KB
testcase_07 AC 15 ms
8,036 KB
testcase_08 AC 16 ms
8,024 KB
testcase_09 AC 15 ms
7,860 KB
testcase_10 AC 16 ms
7,824 KB
testcase_11 AC 15 ms
7,896 KB
testcase_12 AC 16 ms
7,824 KB
testcase_13 AC 16 ms
7,908 KB
testcase_14 AC 16 ms
7,896 KB
testcase_15 AC 16 ms
8,036 KB
testcase_16 AC 16 ms
7,948 KB
testcase_17 AC 16 ms
7,908 KB
testcase_18 RE -
testcase_19 AC 15 ms
8,028 KB
testcase_20 AC 16 ms
7,896 KB
testcase_21 AC 16 ms
8,028 KB
testcase_22 AC 16 ms
7,884 KB
testcase_23 AC 16 ms
7,920 KB
testcase_24 AC 16 ms
7,896 KB
testcase_25 AC 16 ms
7,968 KB
testcase_26 AC 16 ms
8,064 KB
testcase_27 AC 16 ms
7,828 KB
testcase_28 AC 15 ms
7,924 KB
testcase_29 AC 16 ms
7,896 KB
testcase_30 AC 15 ms
8,028 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 15 ms
7,900 KB
testcase_38 WA -
testcase_39 AC 15 ms
7,900 KB
testcase_40 AC 15 ms
7,976 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *
import math

def solve(n: int) -> int:
    if n == 1:
        return 1
    ans = n + 3
    for j in range(1, 100):
        i = int(math.pow(n, 1/j))
        k = n - i ** j
        assert k >= 0
        ans = min(ans, i + j + k)
    return ans



# generated by oj-template v4.8.0 (https://github.com/online-judge-tools/template-generator)
def main():
    n = int(input())
    a = solve(n)
    print(a)


if __name__ == '__main__':
    main()
0