Chef and Interactive XOR | INTXOR | Video Editorial | December Long

december
editorial
long_challenge
xor

#1

Video editorial of December Challenge 2018

Problem: Chef and Interactive XOR

Editorial: https://www.youtube.com/watch?v=yoJZj8OuFfk


#2

Does your idea works with odd N?

If ask queries in this way, the last query will have just one possibility, where all the indexes are N, like query(N, N, N).


#3

“Also, Chef has an additional condition: for each index x, x may appear in all questions in total at most 3 times” is clearly given in the problem statement , so this approach would fail as index 1 is used 4 times.


#4

Thanks a lot for the solution. I was kind of stuck on the following pattern

a b c

b c d

a b d

a c d

I can find all solution using this pattern, but only if the N%4==0


#5

hii,can anyone please figure out the bug in my code, it was giving correct answer for all the manual testcases,yet was giving WA on submission.
link to my code link text


#6

My solution link text uses the same tactics as your of even and odd,still last two cases fail i am still aware why my code is failing.You can test it too.


#7

Good forum practices recommend posting a small intro/description in the thread instead of just posting the link. :slight_smile:


#8

Thanks for the suggestion :slight_smile:


#9

For odd N

only last two part will modify.

N = 9

1 2 3

1 2 4

3 4 5

3 4 6

5 6 7

5 6 8

7 8 9

7 9 1

8 9 2

now using 1 and 2 question we can find 3rd and 4th elements


#10

No, 1 is used only 3 times if N is odd also.


#11

you’re welcome.