poj 3293 Rectilinear polygon】的更多相关文章

Rectilinear polygon Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2125   Accepted: 249 Description Given is n points with integer coordinates in the plane. Is it is possible to construct a simple, that is non-intersecting, rectilinear…
[题目链接] http://poj.org/problem?id=3293 [题目大意] 给出一些点,每个点只能向外引出一条平行X轴,和Y轴的边, 问能否构成一个闭多边形,如果能,返回多边形的总边长,否则返回-1 [题解] 我们发现对于每一行或者每一列都必须有偶数个点,且两两之间相邻才能满足条件 所以我们将其连线之后判断是否可以构成一个封闭图形,同时还需要判断这些线是否会相交, 如果相交即不成立 [代码] #include <cstdio> #include <algorithm>…
http://poj.org/problem?id=2007 Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 6701   Accepted: 3185 Description A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments ar…
Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5472   Accepted: 2334 Description Polygon is a game for one player that starts on a polygon with N vertices, like the one in Figure 1, where N=4. Each vertex is labelled with an integer and…
Scrambled Polygon Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 7214   Accepted: 3445 Description A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the…
Scrambled Polygon Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 8636   Accepted: 4105 Description A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the…
题链: http://poj.org/problem?id=2007 题解: 计算几何,极角排序 按样例来说,应该就是要把凸包上的i点按 第三像限-第四像限-第一像限-第二像限 的顺序输出. 按 叉积 来排序的确可以A掉,但是显然有错呀. 比如这个例子: 0 0 -2 2 -1 -1 1 0 正确答案显然应该是: (0,0) (-2,2) (-1,-1) (1,0) 但是 用叉积 排序后却是这样: (0,0) (1,0) (-2,2) (-1,-1) (要用叉积排序的话,按道理来讲应该把像限分成…
LINK 题意:给出一个简单多边形,按极角序输出其坐标. 思路:水题.对任意两点求叉积正负判断相对位置,为0则按长度排序 /** @Date : 2017-07-13 16:46:17 * @FileName: POJ 2007 凸包极角序.cpp * @Platform: Windows * @Author : Lweleth (SoungEarlf@gmail.com) * @Link : https://github.com/ * @Version : $Id$ */ #include <…
题目传送门 题意:裸的对原点的极角排序,凸包貌似不行. /************************************************ * Author :Running_Time * Created Time :2015/11/3 星期二 14:46:47 * File Name :POJ_2007.cpp ************************************************/ #include <cstdio> #include <al…
题目链接 题意 : 对输入的点极角排序 思路 : 极角排序方法 #include <iostream> #include <cmath> #include <stdio.h> #include <algorithm> using namespace std; struct point { double x,y; }p[],pp; double cross(point a,point b,point c) { return (a.x-c.x)*(b.y-c.y…