poj 1696 (计算几何基础)】的更多相关文章

poj 1696 Space Ant 链接:http://poj.org/problem?id=1696 题意:在坐标轴上,给定n个点的 id 以及点的坐标(xi, yi),让你以最底端点开始,从右依次找出最外围的的点,形成一个螺旋状的图像.图形见题目例题,输出他们的 id. 思路:先找出最下面的点,然后依次为“据点”,对其他点进行极角排序,取出第一个点,以此点为“据点”,对其他未选择的点极角排序,选出排序后第一个点,……, 依此类推,取得 n 个点.复杂度(n^2*log(n)). 代码: #…
Space Ant Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 3967   Accepted: 2489 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…
三点顺序 时间限制:1000 ms  |  内存限制:65535 KB 难度:3 描写叙述 如今给你不共线的三个点A,B,C的坐标,它们一定能组成一个三角形,如今让你推断A,B,C是顺时针给出的还是逆时针给出的? 如: 图1:顺时针给出 图2:逆时针给出 <图1>                   <图2> 输入 每行是一组測试数据,有6个整数x1,y1,x2,y2,x3,y3分别表示A,B,C三个点的横纵坐标.(坐标值都在0到10000之间) 输入0 0 0 0 0 0表示输入…
http://poj.org/problem?id=1556 首先路径的每条线段一定是端点之间的连线.证明?这是个坑...反正我是随便画了一下图然后就写了.. 然后re是什么节奏?我记得我开够了啊...然后再开大点才a...好囧啊. #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <alg…
http://poj.org/problem?id=2318 第一次完全是$O(n^2)$的暴力为什么被卡了-QAQ(一定是常数太大了...) 后来排序了下点然后单调搞了搞..(然而还是可以随便造出让我的code变成$O(n^2)$的23333) #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include…
http://poj.org/problem?id=2653 我很好奇为什么这样$O(n^2)$的暴力能过.... 虽然说这是加了链表优化的,但是最坏不也是$O(n^2)$吗...(只能说数据太弱...) 然后本题裸的判线段相交和点在直线上...(看了网上的标程,不判端点的情况都能过我也是醉了...) #include <cstdio> #include <cstring> #include <cmath> #include <string> #includ…
http://poj.org/problem?id=1269 我会说这种水题我手推公式+码代码用了1.5h? 还好新的一年里1A了---- #include <cstdio> #include <cstring> #include <cmath> #include <string> #include <iostream> #include <algorithm> #include <queue> #include <…
题目链接:http://poj.org/problem?id=2398 Time Limit: 1000MS Memory Limit: 65536K Description Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in…
题目链接:http://poj.org/problem?id=2318 Time Limit: 2000MS Memory Limit: 65536K Description Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is fin…
题意: 一只特别的蚂蚁,只能直走或者左转.在一个平面上,有很多株植物,这只蚂蚁每天需要进食一株,这只蚂蚁从起点为(0,miny)的点开始出发.求最多能活多少天 分析: 肯定是可以吃到所有植物的,以当前方向无限延长成直线,可以剩余的植物都在直线的左边.所以就是求上一个位置到当前位置与下一个位置与当前位置的夹角,并且使夹角最大. cos(0~pi)是单调递减的,夹角越大,cos值越小.所以我用点积来计算. #include <iostream> #include <cstdio> #i…