_FAHA_'s blog

By _FAHA_, history, 6 weeks ago, In English,

Just like LOJ 1127, in 1235 I want to use Meet in the middle . Here , as we can take any coin for max two times. So, we can pick a coin in three ways .

For n coins the sub array sum will be of 3^n elements . So we can split it in two 3^(n/2) sized arrays .

But how 3^(n/2) combinations of sum can be generated ?

 
 
 
 

»
4 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

Solved :v