結果

問題 No.1737 One to N
ユーザー first_vilfirst_vil
提出日時 2021-11-12 22:06:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 157 ms / 2,000 ms
コード長 156 bytes
コンパイル時間 471 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 79,348 KB
最終ジャッジ日時 2023-08-17 01:44:01
合計ジャッジ時間 4,870 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 157 ms
79,348 KB
testcase_01 AC 71 ms
71,256 KB
testcase_02 AC 92 ms
76,824 KB
testcase_03 AC 69 ms
71,320 KB
testcase_04 AC 86 ms
76,648 KB
testcase_05 AC 155 ms
79,092 KB
testcase_06 AC 156 ms
79,172 KB
testcase_07 AC 150 ms
79,020 KB
testcase_08 AC 86 ms
76,768 KB
testcase_09 AC 88 ms
76,668 KB
testcase_10 AC 109 ms
77,388 KB
testcase_11 AC 86 ms
76,668 KB
testcase_12 AC 98 ms
77,024 KB
testcase_13 AC 113 ms
77,292 KB
testcase_14 AC 132 ms
77,896 KB
testcase_15 AC 138 ms
78,264 KB
testcase_16 AC 102 ms
77,388 KB
testcase_17 AC 106 ms
77,340 KB
testcase_18 AC 107 ms
77,344 KB
testcase_19 AC 84 ms
76,756 KB
testcase_20 AC 83 ms
76,732 KB
testcase_21 AC 122 ms
77,888 KB
testcase_22 AC 84 ms
76,700 KB
testcase_23 AC 123 ms
77,800 KB
testcase_24 AC 113 ms
77,644 KB
testcase_25 AC 101 ms
77,036 KB
testcase_26 AC 92 ms
76,744 KB
testcase_27 AC 70 ms
71,544 KB
testcase_28 AC 110 ms
77,524 KB
testcase_29 AC 70 ms
71,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
dp = [123456789]*(n+1)
dp[1] = 0
for x in range(1,n):
    for y in range(x*2,n+1,x):
        dp[y] = min(dp[y], dp[x] + y//x)
print(dp[n])
0