ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1490. Fire Circle

Some hints
Posted by Strong wind 26 Jun 2009 22:21
1. Use __int64
2. Here is some fragment of my code(and the most significant):
for(x=0;x<r;x++)
k+=ceil(sqrt((double)(r-x)*(r+x))); <----- be careful!!
hint
Posted by KALO 9 Oct 2009 00:26
use binary search and the following relation: x^2+y^2=R^2
Re: hint
Posted by ASK 4 Mar 2010 16:31
One can use Bresenham's circle algorithm to avoid all the FP calculations, but why bother if the TL is more than enough?

http://en.wikipedia.org/wiki/Midpoint_circle_algorithm
Re: Some hints
Posted by LyanA 1 May 2013 14:27
this staff is nice.
that let me deal problem.
looks like sqrt can't handle 100000*100000
also (r-x)(r+x) == r*r - x*x, but first can be handled with sqrt but second not
finally, thanks at all