1301 - Herman

Discussion around the problems of the COJ.
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Post Reply
User avatar
dovier
Posts: 1143
Joined: 9 years ago
Location: Havana, Cuba
Gender: Male
Cuba

1301 - Herman

Post by dovier » 9 years ago




hanimal
Posts: 9
Joined: 6 years ago
Gender: None specified

Re: 1301 - Herman

Post by hanimal » 6 years ago

Buenas, en este ejercicio he buscado la formula para el calculo del area en geometria taxicab y es 2*r^2 y la euclides bueno la que todo sabemos pi*r^2, le he adicionado un epsilon de 1e-6 y 1e-9 para tratar de disminuir el margen de error pero nada, me podrian ayudar? el valor de pi que empleo es 3.141592653589793

Gracias de antemano, saludos.

User avatar
ymondelo20
Posts: 1968
Joined: 9 years ago
Location: Universidad de las Ciencias Informáticas
Gender: None specified
Contact:

Re: 1301 - Herman

Post by ymondelo20 » 6 years ago

Yo lo resolví usando PI = 3.141592653589793115997963468544;
Y restando 5*(1e-5) +-
"Every problem has a simple, fast and wrong solution" OJ's Main Law. ;)

humbertodiaz
Posts: 97
Joined: 6 years ago
Gender: None specified

Re: 1301 - Herman

Post by humbertodiaz » 6 years ago

Yo no utilice un epsilon, pero no queria comentar por que use C# y he notado que los resultados de las operaciones de punto flotante no son consistentes entre distintos lenguajes.

rvargas
Posts: 37
Joined: 7 years ago
Gender: None specified

Re: 1301 - Herman

Post by rvargas » 6 years ago

Con python directamente use math.pi.

Post Reply

Return to “Problem set”