先从给出的两个点集中分别计算出两个凸包,
然后判断两个凸包是否相离。
#include
#include
#include
#include
using namespace std;
const double eps = 1e-10;
double dcmp(double x) {
if(fabs(x) < eps) return 0;
else return x <...
分类:
其他好文 时间:
2014-08-20 01:25:05
阅读次数:
181
The binomial coefficient C(m,n) is defined as
m!
C(m,n) = --------
n!(m-n)!
Given four natural numbers p, q, r, and s, compute the the result of dividing
C(p,q) by C(r,s).
T...
分类:
其他好文 时间:
2014-08-18 23:37:43
阅读次数:
274
Similar strategy could be applied to 4Sum, as 2sum to 3sum, but that'll be O(n^3). Instead of 3 + 1, we can also divide it into 2 + 2. So the problem ...
分类:
其他好文 时间:
2014-08-18 13:00:32
阅读次数:
183
归并(Merge)排序法是将两个(或两个以上)有序表合并成一个新的有序表,即把待排序序列分为若干个有序的子序列,再把有序的子序列合并为整体有序序列。归并排序是建立在归并操作上的一种有效的排序算法。该算法是采用分治法(Divide and Conquer)的一个非常典型的应用。将已有序的子序列合并,得到完全有序的序列;即先使每个子序列有序,再使子序列段间有序。若将两个有序表合并成一个有序表,称为二路...
分类:
其他好文 时间:
2014-08-18 12:32:04
阅读次数:
230
RiskRisk is a board game in which several opposing players attempt to conquer the world. The gameboard consists of a world map broken up into hypothe....
分类:
其他好文 时间:
2014-08-16 20:58:21
阅读次数:
342
归并排序是建立在归并操作上的一种有效的排序算法。该算法是採用分治法(Divide and Conquer)的一个很典型的应用。首先考虑下怎样将将二个有序数列合并。这个很easy,仅仅要从比較二个数列的第一个数,谁小就先取谁,取了后就在相应数列中删除这个数。然后再进行比較,假设有数列为空,那直接将还有...
分类:
其他好文 时间:
2014-08-15 14:13:49
阅读次数:
146
点击打开链接题目链接
Conquer a New Region
Time Limit: 5 Seconds Memory Limit: 32768 KB
The wheel of the history rolling forward, our king conquered a new region in a distant continent.
Ther...
分类:
其他好文 时间:
2014-08-15 10:47:18
阅读次数:
286
Problem Description
FSF has programmed a game.
In this game, players need to divide a rectangle into several same squares.
The length and width of rectangles are integer, and of course the side len...
分类:
其他好文 时间:
2014-08-12 22:06:04
阅读次数:
248
FSF’s gameProblem DescriptionFSF has programmed a game.In this game, players need to divide a rectangle into several same squares.The length and width...
分类:
其他好文 时间:
2014-08-12 21:51:44
阅读次数:
276
利用了随机数方法终于知道错在哪了,中间如果出现连乘还是会yi...
分类:
其他好文 时间:
2014-08-12 13:34:54
阅读次数:
192