1377. 得分通胀
完全背包裸题。
const int N = 10010;
int f[N];
int n, m;
int main() {
cin >> m >> n;
for(int i = 0; i < n; i++) {
int score, time;
cin >> score >> time;
for(int j = time; j <= m; j++)
f[j] = max(f[j], f[j - time] + score);
}
cout << f[m] << endl;
//system("pause");
return 0;
}