Hello all,
I've a question about the judge system, mainly referred to the problem in subject.
I've submitted this linked solution yet, one of the test is failing.
My problem here is that I'm not able to replicate locally the test failure for the 2th test
2
Time: 15 ms, memory: 0 KB
Verdict: WRONG_ANSWER
Input
8
Participant's output
5
Jury's answer
1
Checker comment
wrong answer 1st numbers differ - expected: '1', found: '5'
Yet, in local, for the input 8, I'm getting the right value 1.
Do you know what can cause this discrepancy?
Thank you in advance.
In case the previous source is not visible, the code is included in the screenshot along side with the output.
try to run on custom invocation link.It's giving 5 there also . Also changing log to log2 is giving right answer for test 2 .
thanks for the custom test link: it can be useful.
about the test itself, it is not a matter of log vs log2, rather is about types:
this doesn't work:
this works:
it was precision issue that's why log2 and log gave different answer when i checked .
log(8) = 0.903089987
log(2) = 0.3010299957
Which is a double (floating point) number. But you are using int data type. That's why you're getting the wrong answer. Try changing the datatype to double.