結果

問題 No.1737 One to N
ユーザー lllllll88938494lllllll88938494
提出日時 2022-05-30 15:36:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 81,712 KB
実行使用メモリ 77,680 KB
最終ジャッジ日時 2023-10-21 00:22:06
合計ジャッジ時間 3,057 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
77,680 KB
testcase_01 AC 37 ms
53,492 KB
testcase_02 AC 51 ms
66,676 KB
testcase_03 AC 35 ms
53,492 KB
testcase_04 AC 47 ms
64,428 KB
testcase_05 AC 76 ms
77,680 KB
testcase_06 AC 78 ms
77,672 KB
testcase_07 AC 83 ms
77,484 KB
testcase_08 AC 51 ms
64,432 KB
testcase_09 AC 49 ms
64,480 KB
testcase_10 AC 57 ms
69,244 KB
testcase_11 AC 48 ms
64,436 KB
testcase_12 AC 52 ms
66,864 KB
testcase_13 AC 59 ms
71,460 KB
testcase_14 AC 66 ms
74,044 KB
testcase_15 AC 69 ms
74,844 KB
testcase_16 AC 54 ms
69,068 KB
testcase_17 AC 56 ms
69,200 KB
testcase_18 AC 57 ms
69,200 KB
testcase_19 AC 47 ms
64,372 KB
testcase_20 AC 47 ms
64,392 KB
testcase_21 AC 63 ms
71,692 KB
testcase_22 AC 53 ms
64,408 KB
testcase_23 AC 64 ms
71,740 KB
testcase_24 AC 56 ms
69,380 KB
testcase_25 AC 54 ms
66,892 KB
testcase_26 AC 51 ms
64,544 KB
testcase_27 AC 35 ms
53,492 KB
testcase_28 AC 56 ms
69,256 KB
testcase_29 AC 35 ms
53,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())

dp=[10**8]*(n+1)
dp[1]=0

for i in range(1,n):
    for j in range(2,n+1):
        if i * j > n:
            break
        dp[i*j] = min(dp[i*j],dp[i]+j)
        
print(dp[n])
0