DC-HITMAN's blog

By DC-HITMAN, history, 5 years ago, In English

I got stuck in a problem and need a little bit help

So the problem is you are given an array of size n (n is always even) and In each move, you can remove any two elements from the array and each move will contribute gcd(removed_val_1, removed_val_2) * move_number So we have to maximize the score I don't know the constraints on N but arr[i] <= 10^5

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
5 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

N is <=20

  • »
    »
    5 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    then it will be just trivial bitmask dp if I am not missing something.

    • »
      »
      »
      5 years ago, hide # ^ |
      Rev. 4  
      Vote: I like it 0 Vote: I do not like it

      .

      • »
        »
        »
        »
        5 years ago, hide # ^ |
        Rev. 2  
        Vote: I like it 0 Vote: I do not like it
        Spoiler