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 1011. Conductors

Good advice: don't use real variables, use extended or longint!
Posted by Punkrocker 23 Sep 2004 01:02
  I got "WA on test 3" nine times, when I stored P and Q as
real variables. But when I only substituted "real" by
"extended", I got AC.
  If you don't want to use such advanced methods, like
extended type, you can store P*100 and Q*100 as longint.
This method gets AC too.

Edited by author 23.09.2004 01:04
Re: Good advice: don't use real variables, use extended or longint!
Posted by 汤润泽 4 Feb 2005 09:18
I agree. My program used real variables at first got WA again and again at test 3.
Try this test:
24.80 24.83
The right answer is 129
If you use real, the asnwer is 125
24.80 / 100 * 125 = 31.0000000000
24.83 / 100 * 125 = 31.0375000000
Good Luck!
Re: Good advice: don't use real variables, use extended or longint!
Posted by Grab 22 Apr 2006 23:39
<...>
well, you are rigth

Edited by author 23.04.2006 00:12
Re: Good advice: don't use real variables, use extended or longint!
Posted by Cat 21 Feb 2007 21:31


Edited by author 21.02.2007 21:33
Re: Good advice: don't use real variables, use extended or longint!
Posted by xuanxuan 13 Nov 2007 12:36
I agree!  First, I always WA at text 14, but when I use "extended", I got AC.
Re: Good advice: don't use real variables, use extended or longint!
Posted by Vedernikoff Sergey 13 Nov 2007 17:19
You don't need to use any real types in your programs! The problem can be easily solved with integer types!