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 1953. Biggest Inscribed Ellipse

Strange compilers' effects
Posted by Yermak 15 Jun 2013 23:45
Guys, please comment this:
Visual C++ 2010: WA 29
G++ 4.7.2: WA 47
G++ 4.7.2 C++11: WA 1

I used double type, sqrt function and arithmetic operations.
Re: Strange compilers' effects
Posted by Erop [USU] 16 Jun 2013 21:59
WA 29/47: different precision, you can divide by small number and inaccuracy will greatly increase, if you are lucky - you don't get WA

C++11: don't use %lf, use %f instead, but you also will get WA1, because of sqrt(-EPS) - its nan

Edited by author 17.06.2013 00:16