题目链接:
题意:
给定n个点,用n个点组成的多边形中(可以是凹多边形,但n个点一定要全在多边形上)
在所有能由n个点构成的多边形中
求最小面积的多边形的周长 - 最小周长。
思路:
首先我们选择一个定点,则接下来的数进行一个排列,有(n-1)!个排列。
这个序列相邻两个数之间有一条线段。
判断多边形合法:任意两条线段不相交即可。n^2
剩下就是简单的更新答案了。
所以复杂度是...
分类:
其他好文 时间:
2014-12-07 01:23:21
阅读次数:
207
#include #include #include #include using namespace std;bool mycmp(const string& a, const string& b) { string ta = a + b; string tb = b + a; ...
分类:
其他好文 时间:
2014-11-25 00:12:26
阅读次数:
281
Let $A=A_1\oplus A_2$. Show that
(1). $W(A)$ is the convex hull of $W(A_1)$ and $W(A_2)$; i.e., the smallest convex set containing $W(A_1)\cup...
分类:
其他好文 时间:
2014-11-19 00:04:31
阅读次数:
272
穷竭搜索,bfs,c++,stl,string...
分类:
其他好文 时间:
2014-11-09 15:23:37
阅读次数:
234
Smallest Difference
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 4639
Accepted: 1290
Description
Given a number of distinct decimal digits, you can fo...
分类:
其他好文 时间:
2014-11-08 16:44:18
阅读次数:
284
谱聚类(Spectral Clustering, SC)是一种基于图论的聚类方法——将带权无向图划分为两个或两个以上的最优子图,使子图内部尽量相似,而子图间距离尽量距离较远,以达到常见的聚类的目 的。其中的最优是指最优目标函数不同,可以是割边最小分割——如图1的Smallest cut(如后文的Mi...
分类:
其他好文 时间:
2014-10-19 21:14:49
阅读次数:
258
问题重述: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive num...
分类:
其他好文 时间:
2014-10-19 16:59:06
阅读次数:
232
UVA 11997 - K Smallest Sums题目链接题意:给定k个数组,每一个数组k个数字,要求每一个数字选出一个数字,构成和,这样一共同拥有kk种情况,要求输出最小的k个和思路:事实上仅仅要能求出2组的前k个值,然后不断两两合并就能够了,由于对于每两组,最后答案肯定是拿前k小的去组合。然...
分类:
其他好文 时间:
2014-10-09 01:48:37
阅读次数:
186
首先对每行进行排序,并对与前两行有$A = a_1 \leq a_2 \leq \cdots \leq a_k$和$B = b_1 \leq b_2 \leq \cdots \leq b_k$。首先把所有的$b_i , i\in [1,k]$与$a_1$进行求和,并加入优先队列中。其中最小的必然是$...
分类:
其他好文 时间:
2014-10-02 00:24:41
阅读次数:
202
Selection Sort选择排序The idea of the selection sort is to find the smallest element in the list and exchange it with theelement in the first position. Th...
分类:
其他好文 时间:
2014-09-25 19:44:07
阅读次数:
223