# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1113270 | Yang8on | Knapsack (NOI18_knapsack) | C++17 | 45 ms | 3960 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 file "main"
#define maxn (int) 2005
#define ll long long
#define pii pair<int, int>
#define fi(i, a, b) for(int i = a; i <= b; i ++)
#define fid(i, a, b) for(int i = a; i >= b; i --)
using namespace std;
int S, n, N;
vector<pii> gr[maxn];
pii a[(int)1e5 + 5];
ll dp[maxn];
main() {
// freopen(file".inp", "r", stdin);
ios::sync_with_stdio(false);
cin.tie(0);
cin >> S >> n ;
fi(i, 1, n) {
int v, w, k; cin >> v >> w >> k ;
gr[w].push_back({ v, k });
}
fi(i, 1, S) sort(gr[i].begin(), gr[i].end());
fi(i, 1, S) {
int mx_sl = S/i;
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... |