結果

問題 No.2386 Udon Coupon (Easy)
ユーザー やでな@競プロやでな@競プロ
提出日時 2023-10-08 21:41:28
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 281 ms
コンパイル使用メモリ 87,380 KB
実行使用メモリ 78,136 KB
最終ジャッジ日時 2023-10-08 21:41:34
合計ジャッジ時間 5,754 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,468 KB
testcase_01 AC 69 ms
71,528 KB
testcase_02 AC 95 ms
71,208 KB
testcase_03 AC 70 ms
71,352 KB
testcase_04 AC 73 ms
71,388 KB
testcase_05 AC 70 ms
71,400 KB
testcase_06 AC 69 ms
71,608 KB
testcase_07 AC 90 ms
77,952 KB
testcase_08 AC 70 ms
71,396 KB
testcase_09 AC 69 ms
71,208 KB
testcase_10 AC 85 ms
76,624 KB
testcase_11 AC 83 ms
76,584 KB
testcase_12 AC 84 ms
77,528 KB
testcase_13 AC 85 ms
77,732 KB
testcase_14 AC 90 ms
77,780 KB
testcase_15 AC 85 ms
77,840 KB
testcase_16 AC 85 ms
77,584 KB
testcase_17 AC 87 ms
77,884 KB
testcase_18 AC 84 ms
77,104 KB
testcase_19 AC 84 ms
76,420 KB
testcase_20 WA -
testcase_21 AC 89 ms
77,736 KB
testcase_22 AC 87 ms
77,316 KB
testcase_23 AC 113 ms
77,284 KB
testcase_24 AC 84 ms
76,756 KB
testcase_25 AC 93 ms
77,476 KB
testcase_26 AC 88 ms
77,568 KB
testcase_27 WA -
testcase_28 AC 83 ms
77,132 KB
testcase_29 AC 86 ms
76,912 KB
testcase_30 AC 85 ms
76,452 KB
testcase_31 AC 86 ms
77,172 KB
testcase_32 AC 83 ms
76,536 KB
testcase_33 AC 88 ms
78,096 KB
testcase_34 AC 84 ms
77,320 KB
testcase_35 AC 86 ms
77,608 KB
testcase_36 AC 90 ms
77,860 KB
testcase_37 AC 87 ms
77,592 KB
testcase_38 AC 84 ms
77,300 KB
testcase_39 AC 84 ms
77,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a,b,c = map(int,input().split())

dp = [0]*(n+1)

for i in range(n):
    if not (i%3 == 0 or i%5 == 0 or i%10 == 0):
        continue
    if i+3 <= n:
        dp[i+3] = max(dp[i+3],dp[i]+a)
    if i+5 <= n:
        dp[i+5] = max(dp[i+5],dp[i]+b)
    if i+10 <= n:
        dp[i+10] = max(dp[i+10],dp[i]+c)
        
print(max(dp))
0