mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-03 19:16:27 +00:00
P1802 5倍经验日
R55702811
This commit is contained in:
parent
266211ef37
commit
2c2a273527
19
Luogu/problem/P1802/P1802.cpp
Normal file
19
Luogu/problem/P1802/P1802.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#include <bits/stdc++.h>
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
int n, x, lose[1005], win[1005], use[1005], f[1005];
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
cin >> n >> x;
|
||||||
|
for (int i = 1; i <= n; i++) {
|
||||||
|
cin >> lose[i] >> win[i] >> use[i];
|
||||||
|
}
|
||||||
|
for (int i = 1; i <= n; i++) {
|
||||||
|
for (int j = x; j >= 0; j--) {
|
||||||
|
f[j] = max(f[j] + lose[i], j >= use[i] ? f[j - use[i]] + win[i] : f[j] + lose[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
cout << 5ll * f[x] << endl;
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user