| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1364446 | shreyas_arun | Knapsack (NOI18_knapsack) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct bag
{
ll v, w, k;
};
void solve()
{
ll n, s;
cin >> n >> s;
vector<bag> store(n);
for (auto &i : store)
{
cin >> i.v >> i.w >> i.k;
}
if (n == 1)
{
ll cal = s / store[0].w;
cout << store[0].v * min(cal, store[0].k);
}
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
return 0;
}| # | 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... | ||||
