# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
975750 | Isam | Knapsack (NOI18_knapsack) | C++17 | 1 ms | 604 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>
using namespace std;
#define eb emplace_back
#define int long long
constexpr int sz = 1e5 + 5;
int n, s;
struct ou{
int v, w, k;
} a[sz];
signed main(){
ios_base::sync_with_stdio(0), cin.tie(0);
cin >> s >> n;
for(register int i = 1; i <= n; ++i){
cin >> a[i].v >> a[i].w >> a[i].k;
}
assert(n==1);
cout << min((s/a[1].w) * a[1].v, a[1].k * a[1].v) << '\n';
}
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... |