D. Area of Two Circles' Intersection time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output You are given two circles. Find the area of their intersection. Input The first line contains three int…
分相离,内含,想交三种情况讨论一下. 主要是精度和数据范围的问题,首先数据用long double,能用整型判断就不要用浮点型. 题目中所给的坐标,半径是整型的,出现卡浮点判断的情况还是比较少的. 最后算三角型面积的时候不要用海伦公式,有四个连乘很容易爆数据范围损失精度,即使拆开两两乘也要考虑符号 (取对数也是比较好的办法).(不知道sqrt和cos,sin的精度如何比较 #include<bits/stdc++.h> using namespace std; typedef long dou…
题意:求相交圆的面积.借鉴大神代码,精度超高. #include <fstream> #include <iostream> #include <string> #include <complex> #include <math.h> #include <set> #include <vector> #include <map> #include <queue> #include <stdio…
Description You are given N circles and expected to calculate the area of the union of the circles ! Input The first line is one integer n indicates the number of the circles. (1 <= n <= 1000) Then follows n lines every line has three integers Xi Yi…
Intersection Time Limit: 4000/4000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3018    Accepted Submission(s): 1135 Problem Description Matt is a big fan of logo design. Recently he falls in love with logo made…
题目链接: Intersection Time Limit: 4000/4000 MS (Java/Others)     Memory Limit: 512000/512000 K (Java/Others) Problem Description   Matt is a big fan of logo design. Recently he falls in love with logo made up by rings. The following figures are some fam…
题目链接:POJ 1410 Description You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9) end point: (11,2) rectangle: left-top: (1,5) right-bottom: (7,1) Figure 1: Line se…
http://codeforces.com/problemset/problem/749/B 题意:已知平行四边形三个顶点,求另外一个顶点可能的位置. 思路:用向量来做. #include <cstdio> #include <algorithm> #include <iostream> #include <cstring> #include <string> #include <cmath> #include <queue&g…
传送门 题意:在平面中,有一个圆,有一个点,问能在这个圆中围出最大的圆的圆心坐标和半径.要求这个最大圆不包含这个点. 思路:比较基础的计算几何,要分三种情况,第一种就是这个点在圆外的情况.第二种是点在圆内.第三种是这个点和圆心重合. ac代码 #include <iostream> #include <cstdio> #include <algorithm> #include <cstring> #include <string> #includ…
题目链接: https://codeforces.com/contest/1163/problem/C2 题意: 给出$n$个点,任意两点连接一条直线,求相交直线的对数 数据范围: $1 \le n \le 10^3$ 分析: 先建立所有的直线,可以把直线定义成$ax+ by=c$,但是需要把$a$和$b$的大小化简成最小,保证直线的唯一性 $k=\frac{y_{1}-y_{2}}{x_{1}-x_{2}}$,上下化简,再用点斜式构造$ax+ by=c$ ac代码: #include<bits…