• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






goodniao_1

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页

2014年3月27日

凸包的变形 基点每次都在变化 poj 1696 Space Ant
摘要: 题目来源:http://poj.org/problem?id=1696分析:题意:一只蚂蚁,不会向右转,现在给出平面上很多个点,求解一种走法,能使得蚂蚁能经过的点最多,每个顶点该蚂蚁只能经过一次,且所行走的路线不能发生交叉.思路:先将所有的点按纵坐标从小到大进行排序,选择第一个点然后对剩下的点进行按极角从小到大排序,选择排序后的第一个点,在对剩下的点按极角从小到大进行排序以此到最后一个点。代码如下:#include #include #include #include #include #include #include #include #include #include #include 阅读全文
posted @ 2014-03-27 09:32 goodniao_1 阅读(176) 评论(0) 推荐(1)
 

2014年3月26日

判断线段相交 + vector. erase迭代指针 的使用 poj 2653 Pick-up sticks
摘要: 题目来源:http://poj.org/problem?id=2653分析:题意:按顺序给出一些木棍,输出在最上面的木棍标号。用vector 存储木棍标号, 当前木棍与 vector 中的木棍 相交,则删除该 木棍标号, 注意vector.erase(it) 中 迭代指针的使用。较简洁的写法:dou... 阅读全文
posted @ 2014-03-26 16:47 goodniao_1 阅读(207) 评论(2) 推荐(0)
 
求射线与线段相交的最多交点 poj 4048
摘要: 题目来源:http://poj.org/problem?id=4048Problem E. Chinese Repeating Crossbow Description In Chinese history, Zhuge Liang, prime minister of Shu in three kingdoms period, is regarded as the embodiment of wisdom. When he was dying he passed a book to his apprentice Jiang Wei privately. This book recorded 阅读全文
posted @ 2014-03-26 14:28 goodniao_1 阅读(578) 评论(1) 推荐(0)
 
判断两条直线 共线或 平行 或相交 求交点 叉乘的应用 poj 1269 Intersecting Lines
摘要: 题目来源:http://poj.org/problem?id=1269分析:题目大意:给两个点能够确定一条直线,题目给出两条直线(由4个点确定),要求判断出这两条直线的关系:平行,同线,相交。如果相交还要求出交点坐标。解题思路:先判断两条直线p1p2, q1q2是否共线, 如果不是,再判断 直线 是... 阅读全文
posted @ 2014-03-26 11:08 goodniao_1 阅读(1771) 评论(0) 推荐(0)
 

2014年3月25日

判断直线与线段 是否相交 + 加入误差 故需要判断重点 poj 3304 Segments
摘要: 题目来源:http://poj.org/problem?id=3304分析:题目大意:给出n条线段两个端点的坐标,问所有线段投影到一条直线上,如果这些所有投影至少相交于一点就输出Yes!,否则输出No!。解题思路:如果存在这样的直线,过投影相交点(或投影相交区域中的点)作直线的垂线,该垂线(也是直线... 阅读全文
posted @ 2014-03-25 23:12 goodniao_1 阅读(319) 评论(0) 推荐(0)
 
计算区域中有t 个点的 区域有多少个+计算几何 + 叉乘+sort+ 二分 + map poj 2398 Toy Storage
摘要: 题目来源:http://poj.org/problem?id=2398分析: 计算区域中有t 个点的 区域有多少个。#include #include #include #include #include #include #include #includeusing namespace std;typedef long long ll;const int N =6000;const double PI = 3.1415927;struct Point{ int x,y; Point(){} Point(int x,int y):x(x),y(y){} // 构造函数,方便代... 阅读全文
posted @ 2014-03-25 18:27 goodniao_1 阅读(147) 评论(0) 推荐(0)
 
寻找区域中有几个点 叉乘+二分 poj 2318
摘要: 题目来源:http://poj.org/problem?id=2318一个 矩阵 被分成多个 区域, 然后输入 多个点, 输出 每个区域点的 个数。 当寻找点 落在某个区域时, 用二分法。#include #include #include #include #include #include #include using namespace std;typedef long long ll;const int N =6000;const double PI = 3.1415927;struct Point{ int x,y; Point(){} Point(int x,in... 阅读全文
posted @ 2014-03-25 17:20 goodniao_1 阅读(137) 评论(0) 推荐(0)
 

2014年3月24日

Same binary weight bitset(STL)
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=412Same binary weight时间限制:300ms | 内存限制:65535KB难度:3描述The binary weight of a positive integer is the number of 1's in its binary representation.for example,the decmial number 1 has a binary weight of 1,and the decimal number 1717 (which is 1101 阅读全文
posted @ 2014-03-24 22:35 goodniao_1 阅读(195) 评论(0) 推荐(1)
 
括号配对问题 栈(stack)的利用
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=2括号配对问题时间限制:3000ms | 内存限制:65535KB难度:3描述现在,有一行括号序列,请你检查这行括号是否配对。输入第一行输入一个数N(0#include #include #include #include #include #include #include#include#include#include#include#include#includeusing namespace std;typedef long long LL;char s[10010];int m 阅读全文
posted @ 2014-03-24 20:14 goodniao_1 阅读(252) 评论(0) 推荐(0)
 
汉诺塔(三) 判断操作是否合法 + 栈(stack)数组
摘要: 题目来源:http://acm.nyist.net/JudgeOnline/problem.php?pid=93汉诺塔(三)时间限制:3000ms | 内存限制:65535KB难度:3描述在印度,有这么一个古老的传说:在世界中心贝拿勒斯(在印度北部)的圣庙里,一块黄铜板上插着三根宝石针。印度教的主神梵天在创造世界的时候,在其中一根针上从下到上地穿好了由大到小的64片金片,这就是所谓的汉诺塔。不论白天黑夜,总有一个僧侣在按照下面的法则移动这些金片:一次只移动一片,不管在哪根针上,小片必须在大片上面。僧侣们预言,当所有的金片都从梵天穿好的那根针上移到另外一根针上时,世界就将在一声霹雳中消灭,而梵塔 阅读全文
posted @ 2014-03-24 16:42 goodniao_1 阅读(195) 评论(0) 推荐(0)
 
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 15 下一页