Axelius's blog

By Axelius, history, 9 years ago, In English

Hello guys , ============

Firstly I would like to wish you all Happy New Year.

I am facing some problem in this question

https://uva.onlinejudge.org/index.php?option=onlinejudge&page=show_problem&problem=606

I would really request if some one could provide me some tips on the question.

My code that got WA is this

https://ideone.com/LiUclc

Thanks for the help in advance !

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
Rev. 3   Vote: I like it +4 Vote: I do not like it

Input:

1
6 2
2 1 2 3 4
=
2 2 3 4 5
<

Output:
0
Answer:
5
Checker Log:
Wrong answer expected '5' found '0'

Your output: 0
Correct output: 5

UPD: Udebug says your output is correct, I don't know why though,
The first weighing means that the first 4 coins are correct,
The second weighing is between [2 3] and [4 5] , 2,3, and 4 are correct coins. which means that 5 is incorrect. Please correct me if I am wrong

  • »
    »
    9 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks for the help. Logically yes the answer should be 5 but I don't know why it's showing the output to be 0.

»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it

"Print a blank line between datasets." I would suggest you to use uDebug: https://www.udebug.com/UVa/665, a very nice tool for uva problems