ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1200. Horns and Hoofs

Please write answer for this test
Posted by VasilySlesarev 13 Jul 2009 22:16
This is like test N6

-1.00 34.86
200


My program writes:
303.62
0 17
And gets WA. Please help.

Edited by author 13.07.2009 22:59
Re: Please write answer for this test
Posted by Sergey Lazarev (MSU Tashkent) 14 Jul 2009 00:37
It's right answer. I had WA 7, and got AC after changing float to double. Maybe you have the same problem?
Re: Please write answer for this test
Posted by Vasily Slesarev 14 Jul 2009 00:43
Thank you.
My code:

    __int64 a, b;
    double da, db;
    scanf("%lf%lf", &da, &db);
    a = (__int64)(100*da);
    b = (__int64)(100*db);

I think, it`s all right with precision.
What do you think?
Re: Please write answer for this test
Posted by Sergey Lazarev (MSU Tashkent) 14 Jul 2009 01:20
Try to add after scanf:

da += 0.000000001;
db += 0.000000001;

It helped me when i solved N1316 and also translated double to int.
Re: Please write answer for this test
Posted by Vasily Slesarev 14 Jul 2009 02:19
Thank you very much one more!
Accepted.
Now I know this feauture and will advise it to everyone.