結果

問題 No.2093 Shio Ramen
ユーザー terasaterasa
提出日時 2022-10-07 21:30:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 717 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,200 KB
実行使用メモリ 78,140 KB
最終ジャッジ日時 2023-09-03 00:23:45
合計ジャッジ時間 5,014 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 103 ms
72,648 KB
testcase_01 AC 99 ms
72,940 KB
testcase_02 AC 96 ms
72,652 KB
testcase_03 AC 98 ms
72,708 KB
testcase_04 AC 101 ms
72,696 KB
testcase_05 AC 101 ms
72,424 KB
testcase_06 AC 98 ms
72,696 KB
testcase_07 AC 101 ms
72,716 KB
testcase_08 AC 101 ms
72,844 KB
testcase_09 AC 111 ms
78,100 KB
testcase_10 AC 113 ms
78,016 KB
testcase_11 AC 104 ms
77,236 KB
testcase_12 AC 112 ms
77,596 KB
testcase_13 AC 111 ms
78,004 KB
testcase_14 AC 109 ms
77,588 KB
testcase_15 AC 116 ms
77,748 KB
testcase_16 AC 110 ms
77,788 KB
testcase_17 AC 111 ms
77,956 KB
testcase_18 AC 112 ms
77,588 KB
testcase_19 AC 110 ms
77,864 KB
testcase_20 AC 110 ms
77,752 KB
testcase_21 AC 110 ms
77,752 KB
testcase_22 AC 113 ms
77,752 KB
testcase_23 AC 115 ms
78,140 KB
testcase_24 AC 114 ms
77,936 KB
testcase_25 AC 110 ms
77,984 KB
testcase_26 AC 110 ms
77,860 KB
testcase_27 AC 114 ms
77,724 KB
testcase_28 AC 109 ms
78,088 KB
testcase_29 AC 111 ms
77,928 KB
testcase_30 AC 113 ms
77,828 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
# import pypyjit
import itertools
import heapq
import math
import bisect
from collections import deque, defaultdict
from functools import lru_cache, cmp_to_key


# for AtCoder Easy test
if __file__ == 'prog.py':
    pass
else:
    sys.setrecursionlimit(10 ** 6)
# pypyjit.set_param('max_unroll_recursion=-1')

input = sys.stdin.readline


def readints(): return map(int, input().split())
def readlist(): return list(readints())
def readstr(): return input()[:-1]


N, I = readints()
R = [tuple(readints()) for _ in range(N)]
dp = [0] * (I + 1)
for i in range(N):
    s, a = R[i]
    for j in range(I, 0, -1):
        if j - s < 0:
            break
        dp[j] = max(dp[j], dp[j - s] + a)
print(max(dp))
0