| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1357200 | po_rag526 | Knapsack (NOI18_knapsack) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int s, n;
cin >> s >> n;
if (n != 1) {
cout << "\n";
return 0;
}
int v, w, k;
cin >> v >> w >> k;
int res = 0;
int weight = 0;
int maxy = 0;
while (weight <= n + 1) {
weight += w;
if (weight > w) break;
maxy += v;
}
return maxy;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
