会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
走走
慢慢沉淀...
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
4
5
6
7
8
9
10
11
12
···
17
下一页
2021年2月28日
(图论)汤圆防漏理论
摘要: 题目链接 题意 \(题目让我们找到一个最大值k,使得每删去一个点v,都使得删去点的边权和不超过k.\) 思路 \(容易想到一定是优先删去边权和最小的最好\) \(所以这里要始终能找到一个最小边权之和的点,用set就很方便\) \(我们先把所有点放入set,每次拿出边权和最小的点,用它去更新其他点的边
阅读全文
posted @ 2021-02-28 12:46 phr2000
阅读(72)
评论(0)
推荐(0)
2021年2月25日
拓扑排序
摘要: 家族树 \(拓扑排序模板\) \(拓扑排序基于bfs\) #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie(0); inline int
阅读全文
posted @ 2021-02-25 17:12 phr2000
阅读(58)
评论(0)
推荐(0)
2021年2月24日
欧拉路与欧拉回路
摘要: https://www.acwing.com/problem/content/submission/code_detail/4121247/ 知识点 #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_std
阅读全文
posted @ 2021-02-24 21:04 phr2000
阅读(52)
评论(0)
推荐(0)
2021年2月23日
(dp)Maximum width
摘要: Maximum width $如何在m个点中找到最大的间隔? $ \(预处理l[],r[]分别表示第i个点最左可以在哪和最右可以在拿\) \(ans=max(ans,r[i+1]-l[i])\) #include <bits/stdc++.h> using namespace std; #defin
阅读全文
posted @ 2021-02-23 23:23 phr2000
阅读(79)
评论(0)
推荐(0)
二分(Max Median)
摘要: Max Median \(题意:给定长度为n的序列,找到一个子序列长度\ge k的a[l..r],使中位数最大\) \(二分答案\) \(将大于等于x的数标记为1,否者标记为-1,求一遍前缀和可快速确定x能否为这一段的中位数\) \(因为长度不确定所以再记录前缀的最小值,那么若满足s[i]-ms[i
阅读全文
posted @ 2021-02-23 13:28 phr2000
阅读(109)
评论(0)
推荐(0)
2021年2月22日
Glass Half Spilled
摘要: Glass Half Spilled \(dp\) \(f[k][j]表示选k个杯子,总体积为j的条件下装水的最大值\) \(转移方程:f[k][j]=max(f[k][j],f[k-1][j-v[i]]+w[i])\) \(注意初始化,很多方案是不合法的\) \(对于每一个f[k][j],它的答案
阅读全文
posted @ 2021-02-22 23:25 phr2000
阅读(55)
评论(0)
推荐(0)
Row GCD
摘要: Row GCD \(gcd\) \(gcd(a,b)=gcd(a-b,b)\) \(gcd(a_1+b_j,…,a_n+b_j)=gcd(a_i-a_{i-1},a[1]+b_j)\) #include <bits/stdc++.h> using namespace std; #define IO
阅读全文
posted @ 2021-02-22 21:24 phr2000
阅读(57)
评论(0)
推荐(0)
二分图 : 最小路径重复点覆盖
摘要: 捉迷藏 最小路径重复点覆盖 #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie(0) inline int lowbit(int x) {
阅读全文
posted @ 2021-02-22 17:11 phr2000
阅读(117)
评论(0)
推荐(0)
二分图 : 最大独立集
摘要: 骑士放置 最大独立集 #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie(0) inline int lowbit(int x) { ret
阅读全文
posted @ 2021-02-22 17:09 phr2000
阅读(63)
评论(0)
推荐(0)
二分图 : 最小点覆盖
摘要: 机器任务 最小点覆盖 #include <bits/stdc++.h> using namespace std; #define IO ios::sync_with_stdio(false);cin.tie(0); cout.tie(0) inline int lowbit(int x) { ret
阅读全文
posted @ 2021-02-22 17:07 phr2000
阅读(50)
评论(0)
推荐(0)
上一页
1
···
4
5
6
7
8
9
10
11
12
···
17
下一页
公告