結果

問題 No.2093 Shio Ramen
ユーザー titiatitia
提出日時 2022-10-07 22:10:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 588 ms / 2,000 ms
コード長 267 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 8,396 KB
最終ジャッジ日時 2023-09-03 12:52:22
合計ジャッジ時間 9,926 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
7,944 KB
testcase_01 AC 19 ms
7,960 KB
testcase_02 AC 16 ms
7,820 KB
testcase_03 AC 19 ms
7,820 KB
testcase_04 AC 19 ms
7,852 KB
testcase_05 AC 18 ms
8,012 KB
testcase_06 AC 21 ms
7,824 KB
testcase_07 AC 19 ms
7,832 KB
testcase_08 AC 17 ms
7,944 KB
testcase_09 AC 167 ms
7,800 KB
testcase_10 AC 351 ms
8,336 KB
testcase_11 AC 39 ms
7,812 KB
testcase_12 AC 384 ms
7,888 KB
testcase_13 AC 423 ms
7,960 KB
testcase_14 AC 459 ms
7,868 KB
testcase_15 AC 358 ms
7,872 KB
testcase_16 AC 119 ms
7,828 KB
testcase_17 AC 588 ms
8,220 KB
testcase_18 AC 395 ms
8,308 KB
testcase_19 AC 481 ms
8,340 KB
testcase_20 AC 543 ms
8,380 KB
testcase_21 AC 533 ms
8,308 KB
testcase_22 AC 517 ms
8,308 KB
testcase_23 AC 367 ms
8,224 KB
testcase_24 AC 354 ms
8,292 KB
testcase_25 AC 358 ms
8,352 KB
testcase_26 AC 343 ms
8,272 KB
testcase_27 AC 355 ms
8,380 KB
testcase_28 AC 359 ms
8,396 KB
testcase_29 AC 356 ms
8,316 KB
testcase_30 AC 341 ms
8,220 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,I=map(int,input().split())
SA=[tuple(map(int,input().split())) for i in range(N)]

DP=[0]*1010

for s,a in SA:
    for i in range(1009,-1,-1):
        if s+i<1010:
            DP[s+i]=max(DP[i]+a,DP[s+i])

print(max(DP[:I+1]))
0