結果
| 問題 | No.2232 Miser's Gift | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-03-03 21:43:45 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 18 ms / 2,000 ms | 
| コード長 | 279 bytes | 
| コンパイル時間 | 1,426 ms | 
| コンパイル使用メモリ | 166,860 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-09-17 22:37:00 | 
| 合計ジャッジ時間 | 4,283 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge6 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 55 | 
ソースコード
#include<bits/stdc++.h>
using namespace std;
const int N=1e5+10;
int f[N];
int n,m,x,y;
int main(){
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++){
		scanf("%d%d",&x,&y);
		for (int j=m;j>=x;j--) f[j]=max(f[j],f[j-x]+y);
	}
	for (int i=m-1;i>=0;i--) printf("%d\n",f[m]-f[i]+1); 
}
            
            
            
        