| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1269416 | sepehrfazliii | Knapsack (NOI18_knapsack) | C++20 | 0 ms | 324 KiB |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int s, n; cin >> s >> n;
int dp[s + 10];
for(int i = 0; i < n; i++)
{
int v , w , k; cin >> v >> w >> k;
for (int j = s; j >= 0; j--)
{
for(int c = 1; c <= k and c * w <= j; c++)
{
dp[j] = max(dp[j] , dp[j - c * w] + c * v);
}
}
}
cout << dp[s] << endl;
}| # | 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... | ||||
