結果

問題 No.1664 Unstable f(n)
ユーザー first_vilfirst_vil
提出日時 2021-09-03 21:40:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 375 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 82,556 KB
実行使用メモリ 75,452 KB
最終ジャッジ日時 2024-05-09 02:37:46
合計ジャッジ時間 4,555 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
74,880 KB
testcase_01 AC 67 ms
75,136 KB
testcase_02 AC 62 ms
74,752 KB
testcase_03 AC 60 ms
75,072 KB
testcase_04 AC 62 ms
75,088 KB
testcase_05 AC 62 ms
75,136 KB
testcase_06 AC 63 ms
75,240 KB
testcase_07 AC 62 ms
75,136 KB
testcase_08 AC 64 ms
75,136 KB
testcase_09 AC 63 ms
75,136 KB
testcase_10 AC 61 ms
75,008 KB
testcase_11 AC 61 ms
74,880 KB
testcase_12 AC 62 ms
75,392 KB
testcase_13 AC 64 ms
74,880 KB
testcase_14 AC 60 ms
74,732 KB
testcase_15 AC 61 ms
74,880 KB
testcase_16 AC 61 ms
75,136 KB
testcase_17 AC 62 ms
74,768 KB
testcase_18 AC 62 ms
74,752 KB
testcase_19 AC 61 ms
74,780 KB
testcase_20 AC 61 ms
75,264 KB
testcase_21 AC 62 ms
74,820 KB
testcase_22 AC 62 ms
75,452 KB
testcase_23 AC 62 ms
75,136 KB
testcase_24 AC 62 ms
75,136 KB
testcase_25 AC 62 ms
75,112 KB
testcase_26 AC 64 ms
75,136 KB
testcase_27 AC 62 ms
74,880 KB
testcase_28 AC 61 ms
74,880 KB
testcase_29 AC 61 ms
74,880 KB
testcase_30 AC 62 ms
74,624 KB
testcase_31 AC 61 ms
75,156 KB
testcase_32 AC 62 ms
75,136 KB
testcase_33 AC 63 ms
74,880 KB
testcase_34 AC 62 ms
74,880 KB
testcase_35 AC 60 ms
75,136 KB
testcase_36 AC 62 ms
74,752 KB
testcase_37 AC 62 ms
75,136 KB
testcase_38 AC 61 ms
75,136 KB
testcase_39 AC 62 ms
74,720 KB
testcase_40 AC 62 ms
74,880 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