結果

問題 No.1664 Unstable f(n)
ユーザー first_vilfirst_vil
提出日時 2021-09-03 21:40:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 1,429 ms
コンパイル使用メモリ 86,916 KB
実行使用メモリ 76,400 KB
最終ジャッジ日時 2023-08-21 20:36:27
合計ジャッジ時間 5,624 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
76,084 KB
testcase_01 AC 92 ms
75,980 KB
testcase_02 AC 91 ms
76,192 KB
testcase_03 AC 95 ms
76,088 KB
testcase_04 AC 90 ms
75,924 KB
testcase_05 AC 91 ms
75,924 KB
testcase_06 AC 90 ms
76,256 KB
testcase_07 AC 91 ms
76,392 KB
testcase_08 AC 92 ms
76,060 KB
testcase_09 AC 94 ms
76,112 KB
testcase_10 AC 92 ms
75,744 KB
testcase_11 AC 92 ms
76,140 KB
testcase_12 AC 93 ms
76,032 KB
testcase_13 AC 91 ms
76,148 KB
testcase_14 AC 92 ms
75,964 KB
testcase_15 AC 91 ms
75,964 KB
testcase_16 AC 91 ms
76,148 KB
testcase_17 AC 91 ms
76,064 KB
testcase_18 AC 92 ms
76,180 KB
testcase_19 AC 91 ms
75,972 KB
testcase_20 AC 89 ms
75,980 KB
testcase_21 AC 89 ms
76,236 KB
testcase_22 AC 89 ms
76,028 KB
testcase_23 AC 90 ms
76,004 KB
testcase_24 AC 89 ms
75,900 KB
testcase_25 AC 90 ms
76,200 KB
testcase_26 AC 92 ms
75,896 KB
testcase_27 AC 92 ms
75,960 KB
testcase_28 AC 92 ms
75,784 KB
testcase_29 AC 91 ms
76,088 KB
testcase_30 AC 91 ms
75,792 KB
testcase_31 AC 89 ms
76,096 KB
testcase_32 AC 92 ms
76,400 KB
testcase_33 AC 90 ms
76,008 KB
testcase_34 AC 92 ms
75,788 KB
testcase_35 AC 93 ms
76,292 KB
testcase_36 AC 91 ms
76,300 KB
testcase_37 AC 92 ms
76,144 KB
testcase_38 AC 91 ms
76,056 KB
testcase_39 AC 92 ms
76,108 KB
testcase_40 AC 91 ms
76,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    ans = n
    for j in range(1, 100):
        ok = 1
        ng = int(1e19)
        while ng - ok > 1:
            mid = (ok + ng) // 2
            if pow(mid, j) <= n:
                ok = mid
            else:
                ng = mid
        if n >= pow(ok, j):
            ans = min(ans, ok + j + (n - pow(ok, j)))
    print(ans)
main()
0