题意: 求所有满足PB <= k*PA 的P所在区域与多边形的交面积. 解法: 2014广州赛区的银牌题,当时竟然没发现是圆,然后就没做出来,然后就gg了. 圆的一般式方程: 设A(x1,y1),B(x2,y2),P(x,y), 那么有 最后化成: 一般式里面的D,E,F自然就出来了,如果不记得一般式的话也可以自己推圆心和半径的,然后就是套的模板,模板的原理自己理吧. 代码: #include <iostream> #include <cstdio> #include <…
HDU 5130 Signal Interference(计算几何 + 模板) 题目链接http://acm.hdu.edu.cn/showproblem.php?pid=5130 Description Two countries A-Land and B-Land are at war. The territory of A-Land is a simple polygon with no more than 500 vertices. For military use, A-Land co…
pro:A的监视区域是一个多边形. 如果A的监视区的内满足到A的距离到不超过到B的距离的K倍的面积大小.K<1 sol:高中几何体经验告诉我们满足题意的区域是个圆,那么就是求圆与多边形的交. #include<bits/stdc++.h> #define rep(i,a,b) for(int i=a;i<=b;i++) using namespace std; ; ; struct point{ double x,y; point(){} point(double xx,doubl…
题意: 给出一个\(n\)个点的简单多边形,和两个点\(A, B\)还有一个常数\(k(0.2 \leq k < 0.8)\). 点\(P\)满足\(\left | PB \right | \leq k \left | PA \right |\),求点\(P\)构成的图形与多边形相交的面积. 分析: 推导圆的公式: 高中应该做过这样的题目,我们很容易知道这是一个圆. 下面推导一下圆的方程: 设\(A(x_1, y_1),B(x_2,y_2),P(x,y)\),根据条件列出等式: \(\sqrt{…
求出爆炸点的坐标,就成了多边形与圆相交面积的模板题了... #include<algorithm> #include<iostream> #include<cstring> #include<fstream> #include<sstream> #include<vector> #include<string> #include<cstdio> #include<bitset> #include&l…
链接:https://www.nowcoder.com/acm/contest/141/J 题目描述 Eddy has graduated from college. Currently, he is finding his future job and a place to live. Since Eddy is currently living in Tien-long country, he wants to choose a place inside Tien-long country…
area Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 686    Accepted Submission(s): 265 Problem Description 小白最近被空军特招为飞行员,参与一项实战演习.演习的内容是轰炸某个岛屿...作为一名优秀的飞行员,任务是必须要完成的,当然,凭借小白出色的操作,顺利地将炸弹投到了岛上某个位…
pro:二维平面上,给点N个导弹的初始位置,射出方向,速度.问你是找一点,可以从这一点向任意方向发出拦截导弹,速度未V,最小化最大拦截导弹的时间.  如果要拦截一个导弹,必须在导弹发射之后才可以发射拦截导弹. 题意满足V>max(v导弹). sol:由于V>vmax,所以有二分的性质,那么这道题其实是个水题,(开始没注意到这个条件,一直不知道怎么去做): N个导弹,我们把导弹的目的地内V*time的圆画出来,拦截导弹的发射位置在这个圆内,如果N个圆有交点,说明合法. 由于V>xmax,所…
/* HDU5130 Signal Interference http://acm.hdu.edu.cn/showproblem.php?pid=5130 计算几何 圆与多边形面积交 * */ #include <cstdio> #include <algorithm> #include <cmath> using namespace std; const double Pi=acos(-1.0); ; ; double k; int sgn(double x) { i…
<!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="initial-scale=1.0, user-scalable=no, wi…