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

×

[closed] Where have I made mistake?

I am trying to solve this problem. I am checking from a given state, which subsets we can go to and finding sprague-grundy function. When I am printing the functions, I am getting wrong answer. It is correct for first sample test, but for the second one, it is incorrect.

My solution

p.s. I changed the last few lines in solve function (for variable ans), but I think last one wasn't incorrect as well

asked 09 Sep '15, 15:56

dragonemperor's gravatar image

3★dragonemperor
89321134
accept rate: 10%

closed 14 Sep '15, 08:31

The question has been closed for the following reason "Other" by dragonemperor 14 Sep '15, 08:31


Never mind. I got it. The function checking for sorting was checking in reverse order. So reverse-sorted arrays were considered sorted.

link

answered 14 Sep '15, 08:31

dragonemperor's gravatar image

3★dragonemperor
89321134
accept rate: 10%

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:

×317
×310
×281

question asked: 09 Sep '15, 15:56

question was seen: 696 times

last updated: 14 Sep '15, 08:31