# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
884467 | cabbit | Knapsack (NOI18_knapsack) | C++14 | 105 ms | 8784 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define sz(v) (int)(v).size()
using namespace std;
const int MXn = 100005, MXs = 2e3 + 6;
const long long oo = 1e18;
int S, N;
vector<int> obj[MXs];
int dp[MXs];
signed main(void) {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
#define TASK "KNAPSACK"
if (ifstream(TASK".INP")) {
freopen(TASK".INP", "r", stdin);
freopen(TASK".OUT", "w", stdout);
}
cin >> S >> N;
for (int i = 1, v, w, k; i <= N; i++) {
cin >> v >> w >> k;
k = min(k, S / w);
int tmp = 0;
for (int t = 0; ; t++) {
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |