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 1294. Mars Satellites

To all C++ coders having problems with T#3 or so...
Posted by Intelligent_Design 15 Oct 2006 20:02
In this problem,rounding the double value to the nearest integer appeares to be the most tricky part of the whole problem.
If you want to guarantee correct rounding, do it yourself with floor() and ceil().
At least,as it happened to me.:)
Re: To all C++ coders having problems with T#3 or so...
Posted by LSBG 29 Apr 2008 16:28
You can do it like this:
printf("%.0lf\n", res);
Re: To all C++ coders having problems with T#3 or so...
Posted by ASK 6 Mar 2010 17:33
You are absolutely right: ``cout << int(r)'' is WA, while ``printf("Distance is %.0lf km.", r);'' is AC.