Back to Problem Solutions forum
One of my test is:
644289=122
My solution proposes:
((64+4)-((2-8)*9))
...which breaks down to:
(68 - (-6*9))
(68 - (-54))
(68 + 54))
122
The checker tells me that the test does not give the expected answer...
Is there a rule that we cannot have an operation go below zero?
Please just a minute, I'll check the checker!
If it's any help, I'm getting the same thing with
773825=191 -> (77-(38*(2-5)))
Let me know if you need more test cases, I'm getting this regularly...
Curse on my stupid head. There was a quite small bug which lead to incorrect results when parsing such expressions with negative intermediate results. Though they are allowed. I hope this is fixed now. Please, excuse me :(
And thank you for helping to localize the bug!
No problem. I still have to fix a bug I have with division having to be integer only... but that's in the rules.
A have the same problem:
445853=109
My solution is
(4+((4-(5-8))*(5*3)))
Which evaluates to 109
But checker breaks me with reason Test 1: expression does not give the expected result
And so on with next attempts.
I've posted a right solution after 8-th attempt.
>I've posted a right solution after 8-th attempt.
Sergey, you are right - I've fixed the issue after your 7-th attempt. I'm very sorry. It was stupid that I've made this bug - and I was stupid again when I was lazy to add the calculated result to the error message... :(