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 1443. Rails

exwRabbits_AlMag(VNTU) What's wrong with my formula?! [6] // Problem 1443. Rails 25 Jun 2006 13:59
  Readln(n);
  Readln(ss); delete(ss,pos('.',ss),1); Val(ss,s,r);
  Readln(ss); delete(ss,pos('.',ss),1); Val(ss,l,r);
  count:=(s div l)*n+((s mod l)*n) div l+1;

Please...
Sid Re: What's wrong with my formula?! [5] // Problem 1443. Rails 25 Jun 2006 18:06
Precision is main trouble of this problem =)
I will try to explain...
When you read real number, for example 1.115, after reading you can get something like 1.11499999, and after custing to integer you'll get 1114 instead 1115. Just try different tests.
exwRabbits_AlMag(VNTU) But I read String! [2] // Problem 1443. Rails 26 Jun 2006 11:34
Sid Re: But I read String! [1] // Problem 1443. Rails 26 Jun 2006 11:47
Just give me your e-mail and I'll send you c++ source.
exwRabbits_AlMag(VNTU) Re: But I read String! // Problem 1443. Rails 26 Jun 2006 14:31
I don't need your code!
I want to understand mistake in my formula!

Well. OK, Ok... you've talked me in :)
_magistr.90@mail.ru