I was recently solving atcoder dp problems but for Knapsack 1 & Knapsack 2 I'm having a little problem. I saw errichto's stream and saw others code as well but wasn't able to find out where I'm going wrong.
Here is my code for Knapsack-I: https://atcoder.jp/contests/dp/submissions/15549225
And this is for Knapsack-II : https://atcoder.jp/contests/dp/submissions/15548921
Thank you for your time.