UVALive 6859 Points (凸包)】的更多相关文章

Points 题目链接: http://acm.hust.edu.cn/vjudge/contest/130303#problem/E Description http://7xjob4.com1.z0.glb.clouddn.com/4c9abc79e61f4d543441b48cb0cf6bbe Input The input file contains several test cases, each of them as described below. The first line c…
题意:给定 n 个点,让你用最长的周长把它们严格包围起来,边长只能用小格子边长或者是小格子对角线. 析:先把每个点的上下左右都放到一个集合中,然后求出一个凸包,然后先边长转成题目的方式,也好转两个点的最小的*根号2加上两者差*1. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdli…
题目 链接 题意:在一个网格图上,给出$n$个点的坐标,用一个多边形包围这些点(不能接触,且多边形的边只能是对角线或直线),求多边形的最小周长. 分析 对于每个点,我们考虑与之相邻的4个点.一共由 $4  \times N$ 个点,然后求凸包.对凸包上每对相邻的点,优先走对角线,然后走直线.累加长度即可. #include<bits/stdc++.h> using namespace std; struct Point{ double x, y; Point(, ):x(x), y(y){}…
-----------------------------最优化问题------------------------------------- ----------------------常规动态规划  SOJ1162 I-Keyboard  SOJ1685 Chopsticks SOJ1679 Gangsters SOJ2096 Maximum Submatrix  SOJ2111 littleken bg SOJ2142 Cow Exhibition  SOJ2505 The County…
开发环境;ubuntu 18.04 IDE:clion 2019 源文件.cpp #include <opencv2/opencv.hpp> #include <zbar.h> using namespace cv; using namespace std; using namespace zbar; typedef struct { string type; string data; vector <Point> location; } decodedObject;…
https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2640 http://www.spoj.com/problems/SPOINTS/en/ http://poj.org/problem?id=3805 http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1298 要…
Saint John Festival 题目链接: http://acm.hust.edu.cn/vjudge/contest/127406#problem/J Description Porto's Festa de São João is one of Europe's liveliest street festivals. Its peak is the night of 23rd to 24th of June, with dancing parties from Ribeira to…
题目链接:POJ 3805 Problem Description Numbers of black and white points are placed on a plane. Let's imagine that a straight line of infinite length is drawn on the plane. When the line does not meet any of the points, the line divides these points into t…
题意:给你一个多边形的城堡(多个点),使用最短周长的城墙将这个城堡围起来并保证城墙的每个点到城堡上的每个点的距离都不小于l 题解:因为两点间的直线一定比折线短,所以这样做 先使用所有点求得一个凸包,接着凸包每条边外移l长度,再在每相邻两条线间画一个半径为l的圆弧(想一想为什么) 因为凸包上每个点与平移后对应点相连会垂直于凸包对应的边,所有圆弧的每个角与对应多边形的内角互补 又因为多边形外角和为360度,所有可以看做凸包多加一个半径为l的圆 #include<set> #include<m…
一个n个点的凸多边形,求多边形中离多边形边界最远的距离.实际上就是求凸包最大内接圆的半径. 利用半平面交求解,每次二分枚举半径d,然后将凸包每条边所代表的半平面沿其垂直单位法向量平移d,看所有平移后的半平面的交集是否为空. #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<fstream> #include<sstream&…