Question: Dynamic Programming and Bit Masking & Algorithms Practice Problems
I am unable to understand the editorial which states that we need a dp with 3 states.
I searched for Himanshu Jaju's solution, but couldn't understand a few lines(Line no: 41, why bits is used to + or - ways in answer?).
Link to sol: https://www.hackerearth.com/submission/8127452/
Discuss problems from Codeforces Round #400 here.
What is 2-SAT?
Can you explain Hint-3 ? How can you say that, any intuition or proof ? Doesn't it depend on initial configuration of switch or door?