USACO PROBLEM DP Knapsack with Number Theory

Правка en1, от noobboyyyy, 2021-05-29 10:57:27

Problem Link :http://www.usaco.org/index.php?page=viewproblem2&cpid=1043 My approach was let we will store the K in vector for Each i [1...N] now let say n+1 can be represented as sum of x+y i:e n+1= x+y so answer will be set[n]=Lcm of (Set[x],Set[y]) for every unique pair of x,y but this solution is not working can anyone give correct solution

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский noobboyyyy 2021-05-29 10:57:27 398 Initial revision (published)