题面 第一眼看觉得没这么简单,还觉得是dp 后来仔细一看,这就是一道组合数学题 因为只要2个z和一个y就能组成 … 继续阅读题解 luogu P2646 【数数zzy】
LIS两种解法
第一种解法:O(n^2)算法: 每个数最开始的最长不下降子序列都是1(它自己) 直接从1到n枚举,最长子序列再 … 继续阅读LIS两种解法
一些比较有用的STL函数(转)整合
1.upper_bound和lower_bound用法 两个函数的用法类似,在一个左闭右开的有序区间里进行二分 … 继续阅读一些比较有用的STL函数(转)整合
图论:最短路径综合
#include<bits/stdc++.h> using namespace std; cons … 继续阅读图论:最短路径综合
开拓者:Prim(MST)
#include<bits/stdc++.h> using namespace std; cons … 继续阅读开拓者:Prim(MST)
A*:k短路
#include<bits/stdc++.h> using namespace std; cons … 继续阅读A*:k短路
倍增思想:RMQ
#include<bits/stdc++.h> using namespace std; int … 继续阅读倍增思想:RMQ
树状数组及二维数组基本操作
树状数组:(+离散化) #include<iostream> #include<cstdio … 继续阅读树状数组及二维数组基本操作