codlz
codlz
全部文章
分类
不抄模板能解题?(12)
后端开发实践(2)
未归档(21)
题解(1)
归档
标签
去牛客网
登录
/
注册
这都不会?
全部文章
(共66篇)
区间和的个数 线段树查询修改 离散化
const int N = 40005; class SegmentTree { public: struct { int val; int l, r; }tree[N]; inline int ls(int roo...
2021-05-06
0
354
染色法判定二分图 模板题
#include <bits/stdc++.h> using namespace std; const int N = 100005; struct { int to; int nxt; }edges[N << 1]; int head[N], ...
2021-05-06
0
431
二分图的最大匹配 匈牙利算法 模板
#include <bits/stdc++.h> using namespace std; const int N = 505, M = 100005; int n1, n2, m; int head[N], cnt; struct { int to, nxt; ...
2021-05-06
0
381
Huffman Codes 非建树
In 1953, David A. Huffman published his paper “A Method for the Construction of Minimum-Redundancy Codes”, and hence printed his name in the history o...
2021-05-06
0
405
0-1背包 一维数组 模板
#include <bits/stdc++.h> using namespace std; const int N = 1005; int dp[N]; int val[N], weight[N]; int main() { #ifndef ONLINE_JUDGE ...
2021-05-06
0
422
完全背包 一位数组 完全体 模板
#include <bits/stdc++.h> using namespace std; const int N = 1005; int dp[N]; int volume[N], val[N]; int main() { #ifndef ONLINE_JUDGE ...
2021-05-06
0
326
多重背包问题 二进制优化 模板
多重背包问题,其实就是多个0-1背包问题.但如果直接使用0-1背包来做的话,时间复杂度会非常高,这时候就需要二进制优化,可以可以将数量为10的物品拆成1 2 4 3. #include <bits/stdc++.h> using namespace std; using PII = ...
2021-05-06
0
492
除法求值 带权并查集 力扣399
除法求值题目 class Solution { public: int find(int p, vector<int> &father, vector<double> & weight) { if (fath...
2021-05-06
0
398
1489. 找到最小生成树里的关键边和伪关键边 Kruskal
力扣 class Solution { public: vector<int> initDSU(int n) { //初始化并查集 vector<int> ret; for (int i = 0...
2021-05-06
0
397
力扣363 矩形区域不超过K的最大矩形
遍历矩形的上边界和下边界,将二维问题降为一维问题。 在遍历一维的时候,使用前缀和记录,选择符合条件的Sr 和 Sl 力扣 class Solution { public: int maxSumSubmatrix(vector<vector<int>>&...
2021-05-06
0
578
首页
上一页
1
2
3
4
5
6
7
下一页
末页