随笔分类 - Algorithm
摘要:1 #include 2 #include 3 #include 4 #include 5 #include "biginteger.h" 6 using namespace std; 7 struct matrix 8 { 9 BigInteger g[10][10]; 10 int n, m; 11 matrix ope...
阅读全文
摘要:Description Consider a single-elimination football tournament involving 2n teams, denoted 1, 2, …, 2n. In each round of the tournament, all teams stil
阅读全文
摘要:Problem Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical st
阅读全文
摘要:Problem Description 度度熊为了拯救可爱的公主,于是与邪恶大魔王战斗起来。 邪恶大魔王的麾下有n个怪兽,每个怪兽有a[i]的生命值,以及b[i]的防御力。 度度熊一共拥有m种攻击方式,第i种攻击方式,需要消耗k[i]的晶石,造成p[i]点伤害。 当然,如果度度熊使用第i个技能打在第
阅读全文
摘要:1.1三角形 1. 半周长 P=(a+b+c)/2 2. 面积 S=aHa/2=absin(C)/2=sqrt(P(P-a)(P-b)(P-c)) 3. 中线 Ma=sqrt(2(b^2+c^2)-a^2)/2=sqrt(b^2+c^2+2bccos(A))/2 4. 角平分线 Ta=sqrt(bc
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using namespace std; 8 struct BigInteger 9 { 10 static const int BASE = 10; 11 static const int W...
阅读全文
摘要:线段树是一个用一个数组,想象一棵完全二叉树,赋予其一些意义,数组中存储的信息即为每个节点 数组中的0 是不用的。
阅读全文
摘要:POJ 3041 Bessie 驾驶着他的太空飞船呆呆2号在太空旅行,途径一段危险地带,他希望自己能安全通过这段区域,于是他将这片区域的地图扫描进入了太空飞船,地图是一个N x N的网络 (1 <= N <= 500),其中有K颗小行星 (1 <= K <= 10,000)。 还好Bessie有一个
阅读全文
摘要:链式前向星 tarjan LCA GCD&LCM 快速幂 大数加法 大数阶乘 并查集 最长上升子序列(LIS)
阅读全文
摘要:Breadth First Search 宽度优先搜索算法(又称广度优先搜索)是最简便的图的搜索算法之一,这一算法也是很多重要的图的算法的原型。Dijkstra单源最短路径算法和Prim最小生成树算法都采用了和宽度优先搜索类似的思想。其别名又叫BFS,属于一种盲目搜寻法,目的是系统地展开并检查图中的
阅读全文

浙公网安备 33010602011771号