|
|
Spent a hour to realise that you don't need to count left and right parts of figure, only middle I believe I am having precision errors when calculating the solution. I changed from doubles to long doubles and got one more test case, so I believe my solution is correct but not precise enough. Any tips to resolve this? Never mind, there was simplification in the calculations and then I just hard-coded printed out the decimals. This problem is just cancer Yes Some tests: a = 1 ans = 3.666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 a = 1.5 ans = 5.666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666667 a = 666 ans = 2663.66666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666674 a = 1000000000000000000 ans = 3999999999999999999.666666666666666666666666666666666666666666666666666666666666666333333333 Edited by author 03.06.2019 20:30 |
|
|