//n每个用例的点个数 //MAXN为最大点个数 //PTYPE为坐标值类型 #include<iostream> #include<cmath> using namespace std; #define MAXN 1005 #define EPS 1e-10 typedef double PTYPE; struct point { PTYPE x,y; }; struct node { PTYPE k; }; int cmp(const void * a, const void *

Problem A 我没看题,队友很快AC我就没花时间看 Problem B DP题,但是我们确实都没想到方法,实在是我们的经验不足 B题补充: B题的DP方法比较诡异(起码我理

$$ ax^3+bX^2+cx+d=0 $$ 根的关系: $$ x1 + x2 + x3 = (-\frac{b}{a}) $$ $$ x1 \times x2 + x1 \times x3 + x2 \times x3 = \frac{c}{a} $$ $$ x1 \times x2 \times x3 = (-\frac{d}{a}) $$ 牛顿迭代解方程(x0附近的根) double Newton_Iterative(double a,double b,double c,double d,double x0) { double f0,f0d,x; x = x0; do

校赛个人赛第六,七场总结 这两场比赛体现了英文水平的重要性 第六场的题目超长,用词还诡异,话了很长时间才看懂 这两场题目都比较有难度,第六场我只出

POJ 3267 The Cow Lexicon 这题是一道DP问题,我的想法如下: 1.可以令 deleteNum[pos]为输入字符串在pos处需要删除的最少字符数量; 2.如果输入

//并查集 //注意类型匹配 const int maxn = 100002; int DSet[maxn]; void init(int n) { for(int i = 0 ; i <= n ; i ++) DSet[i] = i; } int findP(int id) { if(DSet[id] != id) DSet[id] = findP(DSet[id]); return DSet[id]; } //返回根节点ID int UnionEle(int a,int b) { a = findP(a); b

/** * KMP模式匹配 * 算法复杂度O(m+n) * ACM 模板 * * @Author OWenT * @link http://www.owent.net */ // 最大字符串长度 const int maxLen = 10000; // 前一个匹配位置,多次匹配注意要重新初始化 // 注: