Space Ant(极角排序)】的更多相关文章

#include<cstdio> #include<cstring> #include<cmath> #include<iostream> #include<algorithm> #include<queue> using namespace std; ; const double PI = acos(-1.0); const double INF = 100000000.000000; struct Point{ int index…
题目大意:给出n个点的编号和坐标,按逆时针方向连接着n个点,按连接的先后顺序输出每个点的编号. 题目思路:Cross(a,b)表示a,b的叉积,若小于0:a在b的逆时针方向,若大于0a在b的顺时针方向.每次都sort一下,找出在当前点逆时针方向的最远的点.数据很小O(N*N*log(N))的复杂度0s AC了-- #include<cstdio> #include<cstdlib> #include<cmath> #include<iostream> #in…
http://poj.org/problem?id=1696 极角排序是就是字面上的意思   按照极角排序 题目大意:平面上有n个点然后有一只蚂蚁他只能沿着点向左走  求最多能做多少点 分析:  其实还不知道极角排序到底是什么,   但是又好像知道一点   必须一直排序  然后一直找到最左的点就行了 #include<stdio.h> #include<math.h> #include<algorithm> #include<iostream> #inclu…
链接:http://poj.org/problem?id=1696 Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 3077   Accepted: 1965 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an a…
Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2489   Accepted: 1567 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y19…
Space Ant http://poj.org/problem?id=1696 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 5371   Accepted: 3343 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-…
Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 2876   Accepted: 1839 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y19…
题意:平面上有n个点,一只蚂蚁从最左下角的点出发,只能往逆时针方向走,走过的路线不能交叉,问最多能经过多少个点. 思路:每次都尽量往最外边走,每选取一个点后对剩余的点进行极角排序.(n个点必定能走完,这是凸包的性质决定的) #include<stdio.h> #include<string.h> #include<math.h> #include<iostream> #include<algorithm> using namespace std;…
题目链接:http://poj.org/problem?id=1696 题意:给你n个点,然后我们用一条线把它们连起来,形成螺旋状: 首先找到左下方的一个点作为起点,然后以它为原点进行极角排序,找到极角最小的那个点,如果又多个选距离近的,每次都这样循环找n个点即可; #include <stdio.h> #include <iostream> #include <algorithm> #include <string.h> using namespace s…
Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 4970   Accepted: 3100 Description The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y19…