Overlapping discsProblem code: M5 |
All submissions for this problem are available.
The problem statement has been updated.
The time limit for this problem is now 5 seconds.
You are given n discs on plane, of the same radius (r=1). Output the area of the part of the plane which is covered by each disc.
Input
First, 1<=t<=10, the number of tests. Each testcase is of the following form: 1<=n<=100000, then n pairs of floating point coordinates follow: -1000<=xi,yi<=1000, representing the location of the i-th disc.
Output
For each testcase, output the total area covered by the intersection of all discs. Round the answer to 6 decimal digits after the point.
Example
Input: 1 2 0 0 0 1 Output: 1.228370
| Author: | admin |
| Date Added: | 29-01-2010 |
| Time Limit: | 2 - 5 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, ERL, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments
SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:
HELP
Program should read from standard input and write to standard output. After you submit a solution you can see your results by clicking on the [My Submissions] tab on the problem page. Below are the possible results:
- Accepted
Your program ran successfully and gave a correct answer. If there is a score for the problem, this will be displayed in parenthesis next to the checkmark. - Time Limit Exceeded
Your program was compiled successfully, but it didn't stop before time limit. Try optimizing your approach. - Wrong Answer
Your program compiled and ran succesfully but the output did not match the expected output. - Runtime Error
Your code compiled and ran but encountered an error. The most common reasons are using too much memory or dividing by zero. For the specific error codes see the help section. - Compilation Error
Your code was unable to compile. When you see this icon, click on it for more information.
If you are still having problems, see a sample solution here.

Fetching successful submissions

Hi, I have some doubts. How
Hi,
I have some doubts.
How the overlapping pattern would be? Whether a third circle can overlap in the region where 2 circles already overlap?
Also.. Its is difficult to generalize the solution.. So it will be nice if we get sample output for atleast 3 circles.
There is no restraint on the
There is no restraint on the locations of the circles. The intersection could be formed by any number of them.
There is no need for additional test cases; the sample output is solely there to make sure the problem is understandable.
" output the total area
There is ambiguity between
output should be the common