You are viewing a single comment's thread. Return to all comments →
In c++, the handler code for main() is missing loops for all test cases.
P.S: You can use this code as main function
int main() { int t; cin>>t; vector<int> k_f; vector<vector<int> > arr_f; for(int i=0;i<t;i++) { int n,k; cin>>n>>k; vector<int> arr(n); for(int j=0;j<n;j++) { cin>>arr[j]; } k_f.push_back(k); arr_f.push_back(arr); } for(int i=0;i<t;i++) { cout<<unboundedKnapsack(k_f[i],arr_f[i])<<endl; } return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
Knapsack
You are viewing a single comment's thread. Return to all comments →
In c++, the handler code for main() is missing loops for all test cases.
P.S: You can use this code as main function