0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-23 19:28:48 +00:00
https://sjzezoj.com/submission/55332
This commit is contained in:
Baoshuo Ren 2022-08-24 11:06:16 +08:00
parent e49b75789d
commit 838adadd01
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
22 changed files with 98 additions and 0 deletions

35
S2OJ/1495/1495.cpp Normal file
View File

@ -0,0 +1,35 @@
#include <iostream>
using std::cin;
using std::cout;
const char endl = '\n';
const int N = 1005;
int n, v[N], w[N], f[N], ans;
int main() {
std::ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> v[i];
}
for (int i = 1; i <= n; i++) {
cin >> w[i];
}
for (int i = 1; i <= n; i++) {
for (int j = n; j >= v[i]; j--) {
f[j] = std::max(f[j], f[j - v[i]] + w[i]);
ans = std::max(ans, f[j]);
}
}
cout << ans << endl;
return 0;
}

BIN
S2OJ/1495/data/data1.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data1.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data10.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data10.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data2.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data2.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data3.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data3.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data4.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data4.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data5.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data5.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data6.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data6.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data7.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data7.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data8.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data8.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data9.in (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/data9.out (Stored with Git LFS) Normal file

Binary file not shown.

BIN
S2OJ/1495/data/problem.conf (Stored with Git LFS) Normal file

Binary file not shown.