Submission #974846

#TimeUsernameProblemLanguageResultExecution timeMemory
974846vjudge1Knapsack (NOI18_knapsack)C++98
12 / 100
1 ms500 KiB
#include <bits/stdc++.h> using namespace std; // Driver code int main() { int W; int n; cin>>W>>n; int v[n]; int we[n]; int x; for (int i = 0; i < n; i++) { cin>>v[i]; cin>>we[i]; cin>>x; } if(n==1){ if(W/we[0]<x){ cout<<v[0]*(W/we[0]); }else{ cout<<v[0]*x; } } 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...