FZU 2148 Moon Game】的更多相关文章

 FZU 2148  Moon Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u   Description Fat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consider as a kind of two-dimen…
Moon Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice FZU 2148 Description Fat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consider as…
Moon Game Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description Fat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consider as a kind of two-dime…
题意:给一些点,问这些点能够构成多少个凸四边形 做法: 1.直接判凸包 2.逆向思维,判凹包,不是凹包就是凸包了 怎样的四边形才是凹四边形呢?凹四边形总有一点在三个顶点的内部,假如顶点为A,B,C,D,则构成四个三角形:ABC,ACD,ABD,BCD,假如某一个三角形(最外的三个顶点)的面积等于另三个三角形面积之和,则是凹四边形. 然后做四个for循环,枚举即可,因为N最多才30. 代码: #include <iostream> #include <cstdio> #include…
                                                                                              Problem 2148 Moon Game Problem Description Fat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consid…
题目:http://acm.fzu.edu.cn/problem.php?pid=2148 题意:给出n个点,判断可以组成多少个凸四边形. 思路: 因为n很小,所以直接暴力,判断是否为凸四边形的方法是: 如果4个点中存在某个点D,Sabd + Sacd + Sbcd = Sabc,则说明是凹四边形. #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #inc…
题目链接 题意 : 给你n个点,判断能形成多少个凸四边形. 思路 :如果形成凹四边形的话,说明一个点在另外三个点连成的三角形内部,这样,只要判断这个内部的点与另外三个点中每两个点相连组成的三个三角形的面积和要与另外三个点组成的三角形面积相同. 中途忘了加fabs还错了好几次 //FZU2148 #include <cstdio> #include <cstring> #include <iostream> #include <cmath> #define e…
题目传送门 题意:给了n个点的坐标,问能有几个凸四边形 分析:数据规模小,直接暴力枚举,每次四个点判断是否会是凹四边形,条件是有一个点在另外三个点的内部,那么问题转换成判断一个点d是否在三角形abc内 易得S (abd) + S (acd) + S (bcd) == S (abc),求三角形面积 收获:比赛时没写出来,没想到用面积就轻松搞定,脑子有点乱,开始敲了计算几何点是否在凸多边形内的模板,WA了,整个人都不好了.收获就是要把计算几何的基础补上来 代码: /*****************…
Problem 2148 Moon Game Accept: 24    Submit: 61 Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem Description Fat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consider as a kind of two-…
Problem 2148 Moon Game Time Limit: 1000 mSec Memory Limit : 32768 KB  Problem Description Fat brother and Maze are playing a kind of special (hentai) game in the clearly blue sky which we can just consider as a kind of two-dimensional plane. Then Fat…