Beltways - precision issue

Back to Topic List

aszaloki     2025-08-08 07:55:07

Hi Kevin,

now I am very close to the expected answers in this problem. For the example my solution results the following (without rounding nothing):

Inner: ((5.67837294961269;6.41124580955194)), R = 2.63953971257027 Outer1: ((-1.58797086648442;3.00787241718307)), R = 5.37107229471158 Outer2: ((8.2872367831748;19.121433094698)), R = 9.78225402414394 Outer3: ((17.6875240409651;-0.948571371558306)), R = 11.0563890974752

Inner: ((2.14804555745623;-9.7931047307623)), R = 0.248447034494667 Outer1: ((1.71404425346976;-8.8648681641239)), R = 0.546813931461292 Outer2: ((-0.0205680739394267;-11.7489519004755)), R = 2.67186356017525 Outer3: ((3.02915295474715;-10.3230407148838)), R = 0.548860521721175 774.903804964772 24.3007998489087

I tried calculating the total sum of the circle areas with different precision of the radii, I could not get closer to you results with the given error treshold. ( I assume that you round the center coordinates and/or the radii somewhere during the calculation)

Maybe it is worth to modify the checker to calculate with precise values.

What do you think?

aszaloki     2025-08-08 07:56:18

New line character is trimmed after posting, so these are my answers:

774.903804964772 24.3007998489087

admin (Kevin)     2025-08-08 13:40:45
User avatar

Hi Adam!

I'm guessing your calculations are usually lower than what is "expected"? I'd suggest looking over your this.Result.Add() line once more - otherwise you might have it mostly figured out :)

aszaloki     2025-08-08 13:47:59

Oh, thanks. What a silly bug... :D

Please login and solve 5 problems to be able to post at forum