摘要: 最长公共子序列不需要字符连续出现和字串不同 //LCS 求最长公共子串模板题 Common Subsequence 描述 A subsequence of a given sequence is the given sequence with some elements (possible none 阅读全文
posted @ 2019-09-10 22:56 Sjhhhhh 阅读(271) 评论(0) 推荐(0) 编辑
摘要: //bfs求最小行走步数模板题 TOJ-2481: Knight Moves 描述 Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from 阅读全文
posted @ 2019-09-10 21:42 Sjhhhhh 阅读(370) 评论(0) 推荐(0) 编辑
摘要: 希望大家都可以越来越好 树状数组关键在于数组元素下标之间的二进制关系用这个来高效的求和以及更新单个元素的值 树状数组基础模板 #include<bits/stdc++.h> using namespace std; const int N=1e5+5; int a[N]; int tree[N]; 阅读全文
posted @ 2019-08-27 23:05 Sjhhhhh 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 建树: 数据离散化处理例题求区间第K大 阅读全文
posted @ 2019-08-26 23:15 Sjhhhhh 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 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 < 阅读全文
posted @ 2019-08-26 00:21 Sjhhhhh 阅读(265) 评论(2) 推荐(0) 编辑