Submission #1279306

#TimeUsernameProblemLanguageResultExecution timeMemory
1279306efegKnapsack (NOI18_knapsack)C++20
12 / 100
1 ms572 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define pb push_back typedef vector<int> vi; int n,S; vi val,we; int32_t main(){ ios_base::sync_with_stdio(NULL); cin.tie(nullptr); cout.tie(nullptr); cin >> S >> n; int have; for (int i = 0; i < n; i++){ int v,w,k; cin >> v >> w >> k; have = k; val.pb(v); we.pb(w); } cout << min(have,S / we[0]) * val[0] << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...