제출 #750338

#제출 시각아이디문제언어결과실행 시간메모리
750338nguyenneheheKnapsack (NOI18_knapsack)C++14
12 / 100
1 ms320 KiB
#include<bits/stdc++.h> using namespace std; long long sub1(int s, int n, vector<array<int, 3>> &a) { array<int, 3> cur = a[0]; int taken = min(s / cur[1], cur[2]); return 1LL * taken * cur[0]; } signed main() { cin.tie(nullptr)->sync_with_stdio(false); int s, n; cin >> s >> n; vector<array<int, 3>> a(n); for (array<int, 3> &it: a) { cin >> it[0] >> it[1] >> it[2]; } if (n == 1) cout << sub1(s, n, a); }
#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...