Problem 104 Triangle Area

Back to General discussions forum

emmgame221     2014-12-23 06:06:06

I would like to suggest that the answer checking for this problem should use
standard floating point precision instead of whatever it is doing now.
I really don't think cutting off tailing zeroes is supposed to be part of the problem,
and it is right now.

Rodion (admin)     2014-12-23 06:57:31
User avatar

Hi! Thanks for your message!

I reviewed the checker for this problem. It should work all right with floating point numbers - at least I hope so... Isn't it?

If you suspect something is wrong with it, could you please help me investigate this trouble - post the answer you get and another which the system tells you it expects from you. I will be then able to compare them and find out how to improve the problem. Thanks in advance!

P.S. Ah, by the way, checking answers for real numbers in most problems (and this one, I think) expects them to have precision of about 1e-7 (absolute or relative for larger values). So sometimes solutions could not provide such precision if using single-precision values instead of double-precision. E.g. changing variable types from float to double may probably help...

emmgame221     2014-12-23 07:45:37

The problem is that for this question the checker expects no decimal point for answers that come out to a whole
number, and only .5 if it comes out to that. For example:

My solution gives numbers like
4308547.500000 10279502.500000 16089192.000000 18289014.000000 1865493.000000 27380485.000000 19655441.000000 3728019.000000 1289423.000000 1108642.000000 4454745.000000 8114996.000000 6556671.000000 12851863.000000 14732585.000000 But the checker expects
4308547.5 10279502.5 16089192 18289014 1865493 27380485 19655441 3728019 1289423 1108642 4454745 8114996 6556671 12851863 14732585

From what I remember, other problems do not care about unnecessary zeros, although most of them don't come out
to even numbers.

Rodion (admin)     2014-12-23 09:47:06
User avatar

Hi! Thanks for sharing this info... Though I am now even more bewildered :)

I copied your solution to ideone and run it against some input data. Then I submitted it as a TestUser (the data were with trailing zeroes - like in your example!) and the answer was accepted!

So I'm afraid I do not understand what is happening...

Have you experienced the trouble once only or was it steadily reproducing? Is it reproducing still?

emmgame221     2014-12-24 03:23:16

I have had this issue every time I submit on this problem. I have tried it a few more times today, and I am still having my answers rejected when they are identical except for trailing zeroes.

Edit: I did notice that in one case I had something .99999, but my solution failed even in clearly identical cases

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