• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
LyonLys
愿意在角落唱沙哑的歌 再大声也都是给你 请用心听 不要说话 Contact me via E-mail: lyon.lys@gmail.com
博客园    首页    新随笔    联系   管理    订阅  订阅
2013年5月29日
POJ 2164 && LA 3218 Find the Border (Geometry, PSLG 平面直线图)
摘要: 2164 -- Find the Border 卡了一个月啊,都快想放弃了。今天看了一下LRJ的PSLG版的代码,才想起来我的模拟捆包裹法存在的漏洞。那就是对点的坐标进行排序的时候,应该用的sgn()函数来进行比较,而不是我一开始的直接对浮点数进行比较。如果直接对浮点数进行比较,本来距离差不多的点就会被拉伸开来,导致应该是相邻点的点被分隔了。 做法比较简单,我的捆包裹法是先将所有的交点离散出来,然后处理出所有的相邻的点。最后,就是模拟向顺时针转动最多的方向的相邻点移动的所有过程。代码如下: 1 #include <cstdio> 2 #include <cstring> 阅读全文
posted @ 2013-05-29 10:41 LyonLys 阅读(650) 评论(0) 推荐(0)
LightOJ 1203 Guarding Bananas (Convex Hull)
摘要: Jan's LightOJ :: Problem 1203 - Guarding Bananas 简单凸包。处理凸包的时候吧ch写成了pt,wa了两次。 1 #include <cstdio> 2 #include <iostream> 3 #include <algorithm> 4 #include <cstring> 5 #include <cmath> 6 7 using namespace std; 8 9 struct Point {10 double x, y;11 Point() {}12 Point(doub 阅读全文
posted @ 2013-05-29 03:10 LyonLys 阅读(358) 评论(0) 推荐(0)
LightOJ 1239 Convex Fence (Convex Hull)
摘要: Jan's LightOJ :: Problem 1239 - Convex Fence 简单凸包,练手题。 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #include <algorithm> 5 #include <cmath> 6 #include <iostream> 7 8 using namespace std; 9 10 typedef long long LL;11 12 struct Point {13 LL x 阅读全文
posted @ 2013-05-29 02:35 LyonLys 阅读(313) 评论(0) 推荐(0)
hdu 1140 War on Weather (3D-Geometry)
摘要: Problem - 1140 简单的三维几何题,对于每一个点,搜索是否存在卫星直接可见,也就是直线与球体是否交于较近的点。其中,套用的主要是直线与平面交点的函数。模板以及代码: 1 #include <cstdio> 2 #include <cstring> 3 #include <cmath> 4 #include <set> 5 #include <vector> 6 #include <iostream> 7 #include <algorithm> 8 9 using namespace std; 10 阅读全文
posted @ 2013-05-29 02:05 LyonLys 阅读(186) 评论(0) 推荐(0)
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3