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


BUDDYNIM(SNCKPE19) huge error.

Two Random AC codes giving different answers for BUDDYNIM! No offence to the code owners, but it took almost two hours of my team to reach to a verdict for a test case of this question.

The test case:


2 2

1 2

4 7

gives answer as "Alice" in one of the codes and "Bob" in the other. I wonder what is the correct answer because both of those codes have almost no relation in between, and this resulted in our WA with lots of time wasted too. We checked the codes of two random people and with no offence to them, I'm posting the links to the codes for verification from your side.

Thank You!

asked 04 Nov '18, 00:40

include_sajal's gravatar image

accept rate: 0%

edited 04 Nov '18, 01:09

Correct answer is Alice since she can choose table 2 and keep decrementing by 1 and Bob will run out of moves. I guess test cases were weak :(


answered 04 Nov '18, 00:49

abdullah768's gravatar image

accept rate: 17%

Yeah, absolutely correct, I had the same in mind, but was totally confused after seeing the answer as "Bob" in one of the codes. Test cases were not just weak, they were a blunder, as I just saw an AC code giving wrong answer for sample test case only.

(04 Nov '18, 00:55) include_sajal4★

Yes,true! One of the solution is not even passing the given testcases and it is there in successful ones. It is nothing but just a random brute force! This was the first question of the pre-elimination and that too with such weak testcases. Pathetic!

Solution Link -

Expected Ans -




Ans by this solution -




I completely agree with you!These two solutions are giving diff. answers! @include_sajal

Kindly look into this matter! @mgch @kingofnumbers


answered 04 Nov '18, 00:54

ripulvohra8's gravatar image

accept rate: 0%

edited 04 Nov '18, 00:55

I am supposing that Bob win if and only if sorted(a) == sorted(b). But this solution has got WA. Am I right?


answered 04 Nov '18, 03:21

batura_dima's gravatar image

accept rate: 5%

edited 04 Nov '18, 03:28

I got my solution accepted using the same logic. Don't forget to remove 0's from the inputs.

0 0
0 0 0
Answer should be Bob not Alice

(04 Nov '18, 07:42) divik5444★

As it has turned out there are possible piles consist of zero items! Pretty logic. Childlike catch.

If I could got AC for this task then I'd qualified for next round. But with such tasks maybe it is better for my calmness that I did not.


answered 04 Nov '18, 03:53

batura_dima's gravatar image

accept rate: 5%

toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

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


question asked: 04 Nov '18, 00:40

question was seen: 2,489 times

last updated: 04 Nov '18, 07:42