結果
| 問題 |
No.2093 Shio Ramen
|
| コンテスト | |
| ユーザー |
SidewaysOwl
|
| 提出日時 | 2022-10-07 21:29:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 87 ms / 2,000 ms |
| コード長 | 326 bytes |
| コンパイル時間 | 459 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 74,240 KB |
| 最終ジャッジ日時 | 2024-06-12 06:09:23 |
| 合計ジャッジ時間 | 3,256 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 30 |
ソースコード
n,I = map(int,input().split())
inf = 10**2
dp = [-inf] * (I+1)
dp[0] = 0
for i in range(n):
n_dp = [-inf] * (I+1)
s,a = map(int,input().split())
for j in range(I+1):
n_dp[j] = max(n_dp[j],dp[j])
if j + s <= I:
n_dp[j+s] = max(n_dp[j+s],dp[j] + a)
dp = n_dp
import sys
print(max(dp))
SidewaysOwl