• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Codjjj
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 5 下一页

2021年10月13日

二分图总结
摘要: 二分图 1.二分图<->不存在奇数环<->染色法不存在矛盾 2.匈牙利算法,匹配,最大匹配,匹配点,增广路径 最大匹配<->不存在增广路径 从左边的非匹配点,沿着一条非匹配边,走到一个匹配点,再沿着一条匹配边,走到一条匹配点,最后...到一个对面的非匹配点 3.最小点覆盖,最大独立集,最小路径点覆盖 阅读全文
posted @ 2021-10-13 18:28 _Codjjj 阅读(38) 评论(0) 推荐(0)
 
 

2021年10月5日

用LCA解次小生成树问题
摘要: 次小生成树 用lca求出每个非树边的路径中的边的最小值和次小值(因为要求的是严格次小生成树),这里有求次小的经典模板。 #include <iostream> #include <cstring> #include <algorithm> #define LL long long using nam 阅读全文
posted @ 2021-10-05 10:34 _Codjjj 阅读(52) 评论(0) 推荐(0)
 
 

2021年9月26日

LCA总结1
摘要: LCA 有根树中 把点本身也称为它的祖先 方法1:向上标记法(不常用) 从一个点开始向上遍历标记,再从第二个开始向上遍历标记,第一个遍历到的标记的点是LCA 方法2:倍增 预处理fa[i,j]表示从i开始,向上走2^j步所能走到的点 $$ 0<=j<=log(n) $$ $$ f[i,j]= f[ 阅读全文
posted @ 2021-09-26 17:58 _Codjjj 阅读(52) 评论(0) 推荐(0)
 
 

2021年9月16日

树上dfs+分组背包
摘要: 有依赖的背包问题 Code: #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 110; int n,V; int f[N][N];//f[i][j]表示以i为 阅读全文
posted @ 2021-09-16 08:49 _Codjjj 阅读(40) 评论(0) 推荐(0)
 
 

2021年9月14日

货币系统(完全背包)
摘要: 货币系统 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 110,M=25010; int n,m; int a[N];//货币 bool f[M];//dp 阅读全文
posted @ 2021-09-14 23:31 _Codjjj 阅读(34) 评论(0) 推荐(0)
 
 

2021年9月10日

求负环
摘要: 基于SPFA (1)统计每个点入队的次数,如果某个点入队n次,则说明存在负环 (2)统计当前每个点的最短路中所包含的边数,如果某点的最短路所包含的边数>=n,则也说明存在环 所有点加入队列 所有点dist[i]=0; 小trick1 spfa算法很有可能会超时,这时候可以: 当所有点的入队次数超过2 阅读全文
posted @ 2021-09-10 15:40 _Codjjj 阅读(57) 评论(0) 推荐(0)
 
混合背包问题+二进制优化
摘要: 混合背包问题 #include <iostream> #include <cstring> #include <algorithm> using namespace std; const int N = 1010; int f[N]; int n,m; int main(){ cin>>n>>m; 阅读全文
posted @ 2021-09-10 15:27 _Codjjj 阅读(34) 评论(0) 推荐(0)
 
回转游戏
摘要: IDA-star深搜+模拟标记法+剪枝 题目:回转游戏 Code: #include <iostream> #include <cstring> #include <algorithm> using namespace std; int ti;//times 次数(IDA star) int g[1 阅读全文
posted @ 2021-09-10 15:17 _Codjjj 阅读(42) 评论(0) 推荐(0)
 
 

2021年9月8日

[转载]算法学习笔记(75): Gosper's Hack
摘要: https://zhuanlan.zhihu.com/p/360512296 能快速算出n的集合的k元子集 阅读全文
posted @ 2021-09-08 08:55 _Codjjj 阅读(150) 评论(0) 推荐(0)
 
 

2021年9月7日

[acwing][模板]基本算法模板
摘要: 快排 void quick_sort(int a[], int l, int r) { if (l >= r)return; int p = a[l]; int i = l - 1, j = r + 1;//左右各移动一格,配合do-while while (i < j) { do i++; whi 阅读全文
posted @ 2021-09-07 10:38 _Codjjj 阅读(109) 评论(0) 推荐(0)
 
 
上一页 1 2 3 4 5 下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3