kushwah_1's blog

By kushwah_1, history, 7 years ago, In English

It would be great if someone can help me with GSMATRIX problem on spoj GSMATRIX

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Although it is not intended solution, you can write slow brute-force solution using recursion with sets of bitsets to get answers for all N. Since N can be up to 120, the maximum answer-maximum depth for recursion will be ceil(log2(120)) = 7.