• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
LyonLys
愿意在角落唱沙哑的歌 再大声也都是给你 请用心听 不要说话 Contact me via E-mail: lyon.lys@gmail.com
博客园    首页    新随笔    联系   管理    订阅  订阅
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 35 下一页
2013年6月21日
poj 1271 && uva 10117 Nice Milk (半平面交)
摘要: uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1058 半平面交求面积最值。直接枚举C(20,8)的所有情况即可。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 #include <cmath> 6 #include <vector> 阅读全文
posted @ 2013-06-21 23:04 LyonLys 阅读(512) 评论(0) 推荐(0)
uva 100 The 3n + 1 problem (RMQ)
摘要: uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=36 预处理,RMQ求区间最大值。代码如下: 1 #include <cstdio> 2 #include <iostream> 3 #include <cstring> 4 #include <algorithm> 5 #include <cmath> 6 7 using namespace std; 8 9 typedef long 阅读全文
posted @ 2013-06-21 21:12 LyonLys 阅读(181) 评论(0) 推荐(0)
uva 11275 3D Triangles (3D-Geometry)
摘要: uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=2250 判断两个空间中的三角形是否有公共点。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <vector> 5 #include <iostream> 6 #include <algorithm> 7 8 using 阅读全文
posted @ 2013-06-21 19:49 LyonLys 阅读(205) 评论(0) 推荐(0)
uva 12296 Pieces and Discs (Geometry)
摘要: http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3717 暴力计算几何。 用切割多边形的方法,将初始的矩形划分成若干个多边形,然后对于每一个圆判断有哪些多边形是与其相交的。面积为0的多边形忽略。 对于多边形与圆相交,要主意圆在多边形内的情况。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include & 阅读全文
posted @ 2013-06-21 18:10 LyonLys 阅读(414) 评论(0) 推荐(0)
poj 1514 Metal Cutting (dfs+多边形切割)
摘要: 1514 -- Metal Cutting 一道类似于半平面交的题。 题意相当简单,给出一块矩形以及最后被切出来的的多边形各个顶点的位置。每次切割必须从一端切到另一端,问切出多边形最少要切多长的距离。 因为最短的切割距离肯定是没有多余的切割痕迹的,而且对于多边形的每一条边,都需要至少经过一次,也就是这些是必要切割。又因为最多就只有8条切割的痕迹,所以我们可以枚举每条痕迹的先后次序,然后模拟切割即刻。复杂度O(n!*n)。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #i 阅读全文
posted @ 2013-06-21 13:48 LyonLys 阅读(339) 评论(0) 推荐(0)
poj 1474 Video Surveillance (半平面交)
摘要: 1474 -- Video Surveillance 跟前一篇3335的是一样的。代码入下: 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 #include <vector> 6 #include <cmath> 7 8 using namespace std; 9 10 struct Point { 11 double x, y; 12 Point() {} 13 Point(double x 阅读全文
posted @ 2013-06-21 11:31 LyonLys 阅读(184) 评论(0) 推荐(0)
poj 3335 Rotating Scoreboard (Half Plane Intersection)
摘要: 3335 -- Rotating Scoreboard 给出一个多边形,要求判断它的内核是否存在。 还是半平面交的题,在这道题中,公告板允许其所在位置与直线共线也算是可见,于是我们就可以将每一条直线微小的移动,然后判断是够能够交出多边形,这样做是因为对于半平面交是不能直接判断是够交集是一个点的情况的。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 #include <vector> 6 #incl 阅读全文
posted @ 2013-06-21 11:26 LyonLys 阅读(213) 评论(0) 推荐(0)
poj 2451 Uyuw's Concert (半平面交)
摘要: 2451 -- Uyuw's Concert 继续半平面交,这还是简单的半平面交求面积,不过输入用cin超时了一次。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 #include <vector> 6 #include <cmath> 7 8 using namespace std; 9 10 struct Point { 11 double x, y; 12 Point() 阅读全文
posted @ 2013-06-21 11:00 LyonLys 阅读(235) 评论(0) 推荐(0)
poj 1279 Art Gallery (Half Plane Intersection)
摘要: 1279 -- Art Gallery 还是半平面交的问题,要求求出多边形中可以观察到多边形所有边的位置区域的面积。其实就是把每一条边看作有向直线然后套用半平面交。这题在输入的时候应该用多边形的有向面积来判断输入的顺序是顺时针的还是逆时针的。 对于半平面交问题,要注意最后半平面返回的是多少个点。对于小于3个点的情况应该直接返回结果,避免计算过程中产生错误。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 #in 阅读全文
posted @ 2013-06-21 10:30 LyonLys 阅读(212) 评论(0) 推荐(0)
hdu 1255 覆盖的面积 (Bruceforce)
摘要: Problem - 1255 暴力统计覆盖超过一次的区域。1y。代码如下: 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <iostream> 5 #include <algorithm> 6 #include <set> 7 8 using namespace std; 9 10 typedef pair<double, int> PDBI;11 multiset<PDBI> pos;12 #defin 阅读全文
posted @ 2013-06-21 06:52 LyonLys 阅读(297) 评论(0) 推荐(0)
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 35 下一页
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3