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

×

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

Video editorial of December Challenge 2018

Problem: Chef and Interactive XOR

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

asked 18 Dec '18, 01:12

cenation092's gravatar image

5★cenation092
15710
accept rate: 6%

edited 22 Dec '18, 17:27

1

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

(18 Dec '18, 01:42) vijju123 ♦♦4★

Thanks for the suggestion :)

(18 Dec '18, 01:54) cenation0925★

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

link

answered 18 Dec '18, 23:21

sdfg04's gravatar image

2★sdfg04
111
accept rate: 0%

you're welcome.

(19 Dec '18, 02:33) cenation0925★

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).

link

answered 18 Dec '18, 07:19

gustavogardusi's gravatar image

4★gustavogardusi
424
accept rate: 0%

1

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

(18 Dec '18, 09:12) cenation0925★

"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.

link

answered 18 Dec '18, 09:32

saad_adeeb's gravatar image

3★saad_adeeb
11
accept rate: 0%

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

(18 Dec '18, 09:36) cenation0925★

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

link

answered 19 Dec '18, 22:59

snapdragon123's gravatar image

3★snapdragon123
11
accept rate: 0%

edited 19 Dec '18, 23:07

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.

link

answered 21 Dec '18, 22:04

apower2's gravatar image

3★apower2
1
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×15,499
×376
×303
×102

question asked: 18 Dec '18, 01:12

question was seen: 1,249 times

last updated: 22 Dec '18, 17:27