結果

問題 No.1664 Unstable f(n)
ユーザー eve__fuyukieve__fuyuki
提出日時 2024-04-09 21:21:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 246 bytes
コンパイル時間 174 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 55,200 KB
最終ジャッジ日時 2024-04-09 21:22:02
合計ジャッジ時間 2,854 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,596 KB
testcase_01 AC 31 ms
54,300 KB
testcase_02 AC 34 ms
54,540 KB
testcase_03 AC 34 ms
54,712 KB
testcase_04 AC 33 ms
54,216 KB
testcase_05 AC 32 ms
53,372 KB
testcase_06 AC 32 ms
53,920 KB
testcase_07 AC 32 ms
53,248 KB
testcase_08 AC 32 ms
53,848 KB
testcase_09 AC 32 ms
54,156 KB
testcase_10 AC 33 ms
53,404 KB
testcase_11 AC 34 ms
55,076 KB
testcase_12 AC 33 ms
53,908 KB
testcase_13 AC 34 ms
53,896 KB
testcase_14 AC 35 ms
54,932 KB
testcase_15 AC 32 ms
54,584 KB
testcase_16 AC 36 ms
54,076 KB
testcase_17 AC 33 ms
54,172 KB
testcase_18 AC 33 ms
53,864 KB
testcase_19 AC 32 ms
54,752 KB
testcase_20 AC 34 ms
54,436 KB
testcase_21 AC 36 ms
54,704 KB
testcase_22 AC 32 ms
53,788 KB
testcase_23 AC 36 ms
53,652 KB
testcase_24 AC 33 ms
54,412 KB
testcase_25 AC 32 ms
53,472 KB
testcase_26 AC 34 ms
54,296 KB
testcase_27 AC 34 ms
53,812 KB
testcase_28 AC 31 ms
54,092 KB
testcase_29 AC 31 ms
54,784 KB
testcase_30 AC 34 ms
53,792 KB
testcase_31 AC 33 ms
53,944 KB
testcase_32 AC 34 ms
53,984 KB
testcase_33 AC 36 ms
54,804 KB
testcase_34 AC 38 ms
55,200 KB
testcase_35 AC 35 ms
54,596 KB
testcase_36 AC 37 ms
54,588 KB
testcase_37 AC 35 ms
54,228 KB
testcase_38 AC 36 ms
54,664 KB
testcase_39 AC 32 ms
53,388 KB
testcase_40 AC 32 ms
54,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

n = int(input())
ans = n
for j in range(2, 64):
	l, r = 1, math.floor(n ** (1 / j)) + 100
	while l + 1 < r:
		mid = (l + r) // 2
		if pow(mid, j) <= n:
			l = mid
		else:
			r = mid
	ans = min(ans, n - pow(l, j) + j + l)

print(ans)
0