question_id's blog

By question_id, 11 years ago, In English

I have tried a long time to understand the following problem. I have also read the tutorial ans comments but everything is unclear to me. I have tried it in papers too. But not getting it.Can anyone please help me to understand the following problem? Thanks in advance.

http://codeforces.me/problemset/problem/319/A

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

| Write comment?
»
11 years ago, hide # |
← Rev. 3  
Vote: I like it 0 Vote: I do not like it

First of all you have to get all dancing pairs then you should calculate the complexity of a pairs' assignment.

for the first test case the dancing pairs are:

(0,3) where 3 = 0 XOR 11

(1,2) where 2 = 1 XOR 11

(2,1) where 1 = 2 XOR 11

(3,0) where 0 = 3 XOR 11

then we look at each pair of dancing pair (a,b) and (c,d) such taht a < c and b > d and we find those pairs (0,3) and (1,2)

(0,3) and (2,1)

(0,3) and (3,0)

(1,2) and (2,1)

(1,2) and (3,0)

(2,1) and (3,0)