- 博客(8)
- 收藏
- 关注
转载 Ice-sugar Gourd
3083: Ice-sugar Gourd描述Ice-sugar gourd, “bing tang hu lu”, is a popular snack in Beijing of China. It is made of some fruits threaded by a stick. The complicated feeling will be like a both...
2019-09-23 21:57:00
946
转载 Toj- Dominoes Game
Dominoes Game描述Recently, my lovely daughter YuYu indulges in playing a game called dominoes. When the game starts, I first place some blocks with varying heights in a long row. I told her ...
2019-09-21 16:17:00
108
转载 KMP
KMP字符串匹配#include <bits/stdc++.h>using namespace std;const int N=10005;int next1[1005];void getnext1(string s){ int i=0/*起始下标*/,j=-1;//起始下标-1 next1[0]=-1; while...
2019-09-12 14:07:00
86
转载 LCS 求最长公共子序列
最长公共子序列不需要字符连续出现和字串不同//LCS 求最长公共子串模板题Common Subsequence描述A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x...
2019-09-10 22:56:00
81
转载 最少行走步数 bfs dfs 求法
//bfs求最小行走步数模板题TOJ-2481: Knight Moves描述BackgroundMr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can yo...
2019-09-10 21:42:00
131
转载 树状数组
希望大家都可以越来越好树状数组关键在于数组元素下标之间的二进制关系用这个来高效的求和以及更新单个元素的值树状数组基础模板#include<bits/stdc++.h>using namespace std;const int N=1e5+5;int a[N];int tree[N];int n,m;int lowb...
2019-08-27 23:05:00
107
转载 静态主席树
建树:#include <bits/stdc++.h>using namespace std;const int N=1e5+7;int n,m,sz;int root[N]/*存放根节点对应的三数组下标*/,ls[N*44]/*存放当前节点所对应的左节点三数组下标*/,rs[N*44]/*同ls*/,sum[N*44];//存放当前区间内数字的个数...
2019-08-26 23:15:00
58
转载 TOJ 5945: 区间覆盖问题
5945: 区间覆盖问题数轴上有N个闭区间[Ai, Bi],选择尽量少的区间覆盖一条指定线段[S, T]。输入第一行为包含三个整数N(1 <= N <=10^5),S和T(-10^6 <= S < T <= 10^6)接下来N行,每行2个整数Ai,Bi(-10^6 <= Ai < Bi < 10...
2019-08-26 00:21:00
146
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人