結果

問題 No.1737 One to N
ユーザー qibqib
提出日時 2023-04-08 20:09:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 136 ms / 2,000 ms
コード長 185 bytes
コンパイル時間 295 ms
コンパイル使用メモリ 82,528 KB
実行使用メモリ 76,504 KB
最終ジャッジ日時 2024-04-14 16:41:50
合計ジャッジ時間 3,761 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 136 ms
76,304 KB
testcase_01 AC 37 ms
53,376 KB
testcase_02 AC 62 ms
66,456 KB
testcase_03 AC 38 ms
53,696 KB
testcase_04 AC 56 ms
63,268 KB
testcase_05 AC 129 ms
76,108 KB
testcase_06 AC 129 ms
76,504 KB
testcase_07 AC 123 ms
75,232 KB
testcase_08 AC 56 ms
64,872 KB
testcase_09 AC 56 ms
64,488 KB
testcase_10 AC 80 ms
68,172 KB
testcase_11 AC 56 ms
63,800 KB
testcase_12 AC 68 ms
66,936 KB
testcase_13 AC 86 ms
68,540 KB
testcase_14 AC 105 ms
72,456 KB
testcase_15 AC 113 ms
74,088 KB
testcase_16 AC 75 ms
67,356 KB
testcase_17 AC 78 ms
68,736 KB
testcase_18 AC 78 ms
67,788 KB
testcase_19 AC 55 ms
63,756 KB
testcase_20 AC 55 ms
63,712 KB
testcase_21 AC 93 ms
72,024 KB
testcase_22 AC 55 ms
63,248 KB
testcase_23 AC 94 ms
71,812 KB
testcase_24 AC 83 ms
68,752 KB
testcase_25 AC 68 ms
65,992 KB
testcase_26 AC 59 ms
65,112 KB
testcase_27 AC 37 ms
53,900 KB
testcase_28 AC 79 ms
68,308 KB
testcase_29 AC 37 ms
52,132 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

INF = 1 << 60

n = int(input())

dp = [INF for _ in range(n + 1)]
dp[1] = 0
for x in range(1, n):
  for y in range(2 * x, n + 1, x):
    dp[y] = min(dp[y], dp[x] + y // x)

print(dp[n])
0