Скоро Codeforces Round 1133 (Div. 1, Div. 2)! Регистрация здесь. ×
Uber interview problem
Разница между en1 и en2, 4 символ(ов) изменены
A box of pre-cooked food contains N dishes and each dish has 2 properties, its Protein content and its Fat content. We need to select a non-empty subset of these N dishes such that the ratio of total Protein content to total Fat content  in these selected subset of dishes is equal to a given target T.↵
↵
Answer Yes if possible, No otherwise.↵
↵
Constraints:↵
1<=N<=50↵
1<=T,Protein_i,Fat_i<=10↵
↵
↵
------------------------------------------------------↵
↵
I don't think bitmask would work given that N can be upto 50. Any other solutions to this problem?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский rasalghul 2018-11-13 22:34:47 249
en2 Английский rasalghul 2018-11-13 22:31:12 4
en1 Английский rasalghul 2018-11-13 22:30:29 575 Initial revision (published)