Submission #975750

#TimeUsernameProblemLanguageResultExecution timeMemory
975750IsamKnapsack (NOI18_knapsack)C++17
12 / 100
1 ms604 KiB
#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)

knapsack.cpp: In function 'int main()':
knapsack.cpp:18:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   18 |  for(register int i = 1; i <= n; ++i){
      |                   ^
#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...