sarkarasm's blog

By sarkarasm, 4 years ago, In English

Link to question: link

code

The question, in short, is to calculate the number of hamiltonian paths from 1 to n. Here I am storing the nodes present in a path as a subset using binary representation. The dp runs for time O(pow(2,n)*n^2) which should be around 4e8. This approach is giving TLE.

Any help would be appreciated and thanks in advance.

Full text and comments »

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

By sarkarasm, 4 years ago, In English

Usually, for long testcases the full testcases are not visible. Is there any reason for this? Cause, it will become much easier to debug our solution if we had access to them. If its not possible to show them, then at least let us download the file.

Full text and comments »

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

By sarkarasm, history, 4 years ago, In English

Can anyone please help, what is wrong with my code?

  1. 86348075

Thanks in advance.

Full text and comments »

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