You are not logged in. Please login at www.codechef.com 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:

1

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.

https://www.codechef.com/viewsolution/21410432

https://www.codechef.com/viewsolution/21414182

Thank You!

asked 04 Nov, 00:40

include_sajal's gravatar image

4★include_sajal
1516
accept rate: 0%

edited 04 Nov, 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 :(

link

answered 04 Nov, 00:49

abdullah768's gravatar image

6★abdullah768
2.4k420
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, 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 - https://www.codechef.com/viewsolution/21419745

Expected Ans -

Alice

Alice

Bob

Ans by this solution -

Alice

Bob

Bob

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

Kindly look into this matter! @mgch @kingofnumbers

link

answered 04 Nov, 00:54

ripulvohra8's gravatar image

5★ripulvohra8
514
accept rate: 0%

edited 04 Nov, 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?

link

answered 04 Nov, 03:21

batura_dima's gravatar image

5★batura_dima
1263
accept rate: 7%

edited 04 Nov, 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, 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.

link

answered 04 Nov, 03:53

batura_dima's gravatar image

5★batura_dima
1263
accept rate: 7%

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:

×587
×52
×13

question asked: 04 Nov, 00:40

question was seen: 2,443 times

last updated: 04 Nov, 07:42