
模板
Twillz
这个作者很懒,什么都没留下…
展开
-
线段树模板
#include #include #include #include #include #define maxn 199999using namespace std;int num[maxn];int segtree[maxn];void plant(int node ,int l,int r){ if(l==r){segtree[nod原创 2017-07-11 15:44:31 · 269 阅读 · 0 评论 -
邻接表构建模板
int cnt=0;struct Node{ int fr;//起点 int to;//终点 int l;//边权 int next;//指向上一条边}e[maxn*5];int head[maxn*5];//head[i]是起点为i的表头void add(int a,int b,int c){ e[cnt].fr=a; e[cnt].to原创 2017-07-17 20:53:06 · 386 阅读 · 0 评论 -
Cash Machine (多重背包)
A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bill denominations, say Dk, k=原创 2017-07-21 13:30:55 · 360 阅读 · 0 评论 -
POJ 3468(线段树模板 Lazy)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 111585 Accepted: 34748 Case Time Limit: 2000MS DescriptionYou have N integers, A1, A2, … , AN.原创 2017-07-18 16:44:05 · 392 阅读 · 0 评论 -
Fibonacci(矩阵快速幂模板)
In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, the first ten terms of the Fibonacci sequence are:0, 1, 1, 2, 3, 5, 8, 13, 21, 34, …An alternative fo原创 2017-07-19 16:12:46 · 286 阅读 · 0 评论 -
次小生成树模板(坑惨了)
In order to prepare the “The First National ACM School Contest” (in 20??) the major of the city decided to provide all the schools with a reliable source of power. (The major is really afraid of blac原创 2017-07-23 18:52:06 · 388 阅读 · 0 评论 -
POJ 3233 Matrix Power (矩阵快速幂+等比数列求和)
Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 23165 Accepted: 9651 DescriptionGiven a n × n matrix A and a positive integer k, find the sum S = A + A2 +原创 2017-07-19 20:15:22 · 537 阅读 · 0 评论 -
POJ 1410 Intersection(矩形和线段的交,线段的交)
Intersection Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15600 Accepted: 4069 DescriptionYou are to write a program that has to decide whether a given line segment interse原创 2017-11-20 22:59:32 · 351 阅读 · 0 评论