Comments
0

Any idea how can I solve Div2C using DP?

0

Thank you very much, though I haven't solved it yet

0

getting YES

0

I tried to solve E using some intuition.

Firstly if there is a number which frequency is greater than 2 then the answer is NO. Secondly if a domino contains two equal number then the answer is NO. Thirdly if there is a number X, then surely there are exactly two dominos where the number X is written.

Our goal is to divide such two dominos where X is common. Now we assume that we can divide these two dominos then there will be X common number and another two or one number. Ex: (1 2) (1 3) (2 4) (3 4) if we put (1 2) in one and (1 3) in other then X = 1 and other two numbers are 2 & 3. or (1 2) (1 2) if we put (1 2) in one and (1 2) in other then X = 1 and other one number is 2.

Now if the division is correct then rest of numbers must not written on same domino. If so then the answer is NO. ex: (1 2) (1 3) (2 3) (4 5) (5 6) (5 6) here if we put (1 2) in a set and (1 3) in other set then (2 3) must be written on two separate dominos, but (2 3) is written on same domino so we can not divide them.

But the solution is now working and I could not find any counter case so far.

My solution getting WA in TC:4 : Solution