![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
计算几何
chr1st0pher
Dancer on the keyboard
展开
-
2020ICPC·小米 网络选拔赛第一场 B. Intelligent Robot (计算几何+最短路)
Description Input 6 3 2 1 1 3 1 2 2 5 2 3 0 3 3 Output 3.8284 Solution 容易发现只有2*k+2个点可能做为路径上的拐点,在这些点上跑最短路即可 建图时需要判断路径的合法性(即不会经过任意一堵墙) 复杂度 = 建图复杂度O((2∗k+2)3)O((2*k+2)^3)O((2∗k+2)3) + (2∗k+2)(2*k+2)(2∗k+2)个点dijkstra复杂度 Code #include <bits/stdc++.h> //p原创 2020-10-30 17:45:47 · 111 阅读 · 0 评论 -
2020牛客多校(第三场) C. Operation Love (几何)
Souce 2020牛客多校第三场 Problem C Solution 题解做法简单明了: 判断输入的顺序(顺时针/逆时针)后,看边的出现顺序是9,8 还是 8,9 就可以判断答案了 判断输入顺序的方法: 按照输入顺序依次计算零点到相邻两个点的向量叉积和,如果是正数说明输入按照逆时针,反之为顺时针 这里所计算的叉积和 / 2 == 多边形面积(凹/凸),面积为正时说明以逆时针枚举点,反之为顺时针 Hint 该题输入数据存在误差,注意误差范围的选取 Code const double eps = 1e-4原创 2020-07-18 21:04:10 · 251 阅读 · 0 评论 -
2020牛客多校(第二场) B. Boundary (计算几何)
Description Given n{n}n points in 2D plane. Considering all circles that the origin point (0,0){(0, 0)}(0,0) is on their boundries, find the one with the maximum given points on its boundry. Print the maximum number of points. Input The first line contains原创 2020-07-13 20:31:09 · 556 阅读 · 0 评论