You are not logged in. Please login at to post your questions!


Need help in this DP question

Hi Everyone, I was trying to solve an SOPJ DP problem. I can't think of how to generalize this problem for each value of n. Please someone have a look and let me know how to tackle this problem. link text thanks in advance.

asked 30 Mar '18, 01:26

va1ts7_100's gravatar image

accept rate: 11%

After getting some help and googling it , it seems clear to me that it basically counting number of ways to arrange numbers from 1 to n , with no consecutive numbers adjacent to each other. It can be solved using dp with bit masking . But because of very large value of n , I can't decide how to determine the state of dp .Can anyone plz help me for any further pointers ?

(30 Mar '18, 22:57) va1ts7_1003★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 30 Mar '18, 01:26

question was seen: 225 times

last updated: 30 Mar '18, 22:57