题意: 有一个不保证凸的多边形,让你滚一圈,计算某点滚出的轨迹多长. 题解: 求出凸包后,以每个点为转轴,转轴到定点的距离为半径,用余弦定理计算圆心角,计算弧长. #include<iostream> #include<cstdio> #include<cmath> #include<cstring> using namespace std; int main() { ; cin>>t; while(t--) { case1++; int n;…
题目链接:Codeforces 437E The Child and Polygon 题目大意:给出一个多边形,问说有多少种切割方法.将多边形切割为多个三角形. 解题思路:首先要理解向量叉积的性质,一開始将给出的点转换成顺时针.然后用区间dp计算.dp[i][j]表示从点i到点j能够有dp[i][j]种分割方法.然后点i和点j能否够做为分割线.要经过推断.即在i和j中选择的话点k的话,点k要在i,j的逆时针方. #include <cstdio> #include <cstring>…
Regular Polygon Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3274    Accepted Submission(s): 996 Problem Description In a 2_D plane, there is a point strictly in a regular polygon with N side…
Scrambled Polygon Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 7214   Accepted: 3445 Description A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the…
Scrambled Polygon Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 8636   Accepted: 4105 Description A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the…
time limit per test4 seconds memory limit per test256 megabytes inputstandard input outputstandard output PolandBall has such a convex polygon with n veritces that no three of its diagonals intersect at the same point. PolandBall decided to improve i…
http://codeforces.com/problemset/problem/437/E 题意:求一个多边形划分成三角形的方案数 思路:区间dp,每次转移只从一个方向转移(L,R连线的某一侧),能保证正确. #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> #include<iostream> #define ll long long ; ll f[]…
原文链接https://www.cnblogs.com/zhouzhendong/p/CF1045E.html 4K码量构造题,CF血腥残暴! 题解 首先,如果所有点颜色相同,那么直接连个菊花搞定. 然后我们建个凸包. 如果凸包上有大于2段颜色(就是至少四段),比如这样 那么必然无解. 否则就只有一段颜色或者两段颜色: 这里我们先不管这个,考虑一个三角形的构造. 考虑三角形三个顶点颜色不全相同的情况,例如: (两个白点的情况是等价的) 假如三角形区域内没有白点,那么直接全部连到其中一个黑点就好了…
题意:如题 用Graham,直接就能得到逆时针的凸包,找到原点输出就行了,赤果果的水题- 代码: /* * Author: illuz <iilluzen[at]gmail.com> * Blog: http://blog.csdn.net/hcbbt * File: poj2007.cpp * Create Date: 2013-11-14 18:55:37 * Descripton: convex hull */ #include <cstdio> #include <c…
include <iostream> #include <cstdio> #include <cstring> #include <string> #include <algorithm> #include <utility> #include <vector> #include <map> #include <queue> #include <stack> #include <c…