0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-25 05:32:00 +00:00

P1855 榨取kkksc03

R41204658
This commit is contained in:
Baoshuo Ren 2020-11-04 10:11:11 +08:00 committed by Baoshuo Ren
parent 89352b82f6
commit 173cae28de
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

21
problem/P1855/P1855.cpp Normal file
View File

@ -0,0 +1,21 @@
#include <bits/stdc++.h>
using namespace std;
int n, m, t, mi[205], ti[205], f[205][205];
int main() {
cin >> n >> m >> t;
for (int i = 1; i <= n; i++) {
cin >> mi[i] >> ti[i];
}
for (int i = 1; i <= n; i++) {
for (int j = m; j >= mi[i]; j--) {
for (int k = t; k >= ti[i]; k--) {
f[j][k] = max(f[j][k], f[j - mi[i]][k - ti[i]] + 1);
}
}
}
cout << f[m][t] << endl;
return 0;
}