poj 3968 (bzoj 2642) 二分+半平面交,每次不用排序,这是几个算几版综合. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<vector> #include<deque> using namespace std; #define MAXN 100000 na…
题目链接:POJ 2451 Problem Description Prince Remmarguts solved the CHESS puzzle successfully. As an award, Uyuw planned to hold a concert in a huge piazza named after its great designer Ihsnayish. The piazza in UDF - United Delta of Freedom's downtown wa…
整理了一下大白书上的计算几何模板. #include <cstdio> #include <algorithm> #include <cmath> #include <vector> using namespace std; //lrj计算几何模板 struct Point { double x, y; Point(, ) :x(x),y(y) {} }; typedef Point Vector; Point read_point(void) { doub…
题目链接:BZOJ - 1336 题目分析 最小圆覆盖有一个算法叫做随机增量法,看起来复杂度像是 O(n^3) ,但是可以证明其实平均是 O(n) 的,至于为什么我不知道= = 为什么是随机呢?因为算法进行前要将所有的点 random_shuffle 一次.为什么要这样做呢?因为这样就可以防止出题人用最坏情况卡掉增量算法. 这和随机化快排使用随机是一个道理. 算法步骤: random_shuffle n 个点 将圆设定为以 P[1] 为圆心,以 0 为半径 for i : 1 to n { if…
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…
题目链接:https://cn.vjudge.net/problem/UVA-12304 题意: 作为题目大合集,有以下一些要求: ①给出三角形三个点,求三角形外接圆,求外接圆的圆心和半径. ②给出三角形三个点,求三角形内接圆,求内接圆的圆心和半径. ③给出一个圆,和一个点,求过该点的圆的切线与x轴的夹角(0<=angle<180): ④给出一条直线,一个点p,指定半径r,求经过点p的与直线相切的半径为r的圆: ⑤给出两条直线,求与这两条直线相切的圆: ⑥给出两个圆,求同时与这两个圆相切的圆:…
Wall Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28157   Accepted: 9401 Description Once upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's castle. The King was so greedy, that he wo…
题目描述 给出N个点,让你画一个最小的包含所有点的圆. 输入输出格式 输入格式: 先给出点的个数N,2<=N<=100000,再给出坐标Xi,Yi.(-10000.0<=xi,yi<=10000.0) 输出格式: 输出圆的半径,及圆心的坐标,保留10位小数 输入输出样例 输入样例#1: 复制 6 8.0 9.0 4.0 7.5 1.0 2.0 5.1 8.7 9.0 2.0 4.5 1.0 输出样例#1: 复制 5.0000000000 5.0000000000 5.0000000…
1336: [Balkan2002]Alien最小圆覆盖 Time Limit: 1 Sec  Memory Limit: 162 MBSec  Special Judge Submit: 1473  Solved: 648 [Submit][Status][Discuss] Description Input 先给出点的个数N,2<=N<=100000,再给出坐标Xi,Yi.(-10000.0<=xi,yi<=10000.0) Output Sample Input 6 8.0…
Basic template 一个基础型模板包括一个向量的实现 DATE: 2015-06-01 #define op operator #define __ while #define _0 return typedef long long ll; inline ll _(ll a,ll b){ll t;__(a){t=a;a=b%a;b=t;}_0 b;} struct frac{ ll u,d; frac(ll u=0,ll d=1):u(u),d(d){} frac op()(){ll…