# The 35th ACM/ICPC Asia Regional Tianjin Site —— Online Contest 1009 Convex 解题报告

The 35th ACM/ICPC Asia Regional Tianjin Site —— Online Contest 2010年天津赛 网络赛 I题 Convex 题目链接：http://acm.hdu.edu.cn/showproblem.php?pi

# Catalan 数

Catalan数: $$h(1)=1,h(0)=1$$ $$h(n)=\begin{cases} \sum_{i=0}^{n-1} h(i) \times h(n-i-1) & \text{if }(n>=2) \\ \frac{C(2n,n)}{n+1} & \text{if }(n=1,2,3,\mathellipsis) \end{cases}$$ 相关结论： n边形能分解成三角形的分法数为 h(n – 2) n个节点能组成的二叉树个数为 h(n) 一个栈(

# 简易四则运算(ACM个人模板)

/** * 简易四则运算（栈实现） * #include <stack> * #include <cstring> */ std::stack<char> opr; std::stack<double> num; char oprPRI; //初始化调用 void initCalc() { //优先级设置 char oprMap = { {'+', 1}, {'-', 1}, {'*', 2}, {'/', 2}, {'^', 3}, {'(', 100}, {')', 0} }; for(int i = 0; i < 7; i

# 线性筛法求质数(素数)表 及其原理

/** * 线性筛法求素数表 * 复杂度: O(n) */ const long MAXP = 1000000; long prime[MAXP] = {0},num_prime = 0; int isNotPrime[MAXP] = {1, 1}; void GetPrime_Init()//初始化调用 { for(long i = 2 ; i < MAXP ; i ++) { if(!

# GCD Determinant 解题报告

http://www.cn210.com/onlinejudge/problemshow.php?pro_id=98 我们的OJ Description &nbsp;</center> Input The next line contains the numbers of&nbsp;S:&nbsp;x1,&nbsp;x2, ...,&nbsp;xn.&nbsp; It is known that each&nbsp;xi&nbsp;is an integer, 0 &le;&nbsp;xi&nbsp;&le; 2*109.&nbsp; The input data set is correct and ends with an end of file.&nbsp;</div> Output &nbsp; Sample Input 2 1 2 3 1 3 9 4 1 2 3 6 Sample Output 1 12 4 首先由于行列式交换