sabo
sabo
全部文章
题解
c++(1)
因果推断(2)
技术栈(1)
机器学习(27)
程序静态分析(1)
算法实践(1)
算法总结(15)
统计(1)
自然语言处理(9)
论文笔记(13)
读书笔记(1)
面经(1)
项目学习(1)
归档
标签
去牛客网
登录
/
注册
Stay Forever Young
Act like a woman, think like a man
全部文章
/ 题解
(共28篇)
角矩形的数量
来自专栏
记录每个列和列之间的pair,然后下次用到就累加,降维的思想 #include <bits/stdc++.h> using namespace std; class Solution { public: int countCornerRectangles(vector<ve...
leetcode
dp
2021-06-17
0
684
字典序最小的K个数字
来自专栏
解题思路:https://leetcode-cn.com/problems/k-th-smallest-in-lexicographical-order/solution/dfsmo-ni-jian-zhi-guo-cheng-by-muyids/ typedef long long LL; cla...
leetcode
2020-08-31
0
845
acwing239 奇偶游戏
题目链接https://www.acwing.com/activity/content/problem/content/474/1/扩展域并查集之前有道带权并查集,这里补一道扩展域并查集 #include <bits/stdc++.h> using namespace std; int ...
并查集
2019-11-14
0
525
acwing240 食物链
题目链接:https://www.acwing.com/problem/content/242/一句话总结:用每一个点到根结点的距离来表示吃的关系余1表示可以根结点,余2表示可以被根结点吃,余0表示和根结点同类根结点可以看成到自己的距离余0Acwing编译器的oj感觉有bug //用带权并查集的做...
并查集
2019-11-14
1
605
luogu p4141 消失之物
洛谷p4141 前后两遍法同Eden的新背包 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int...
dp
2019-10-05
0
567
luogu2549 计算器写作文
luogu p2549 字符串01背包 #include <bits/stdc++.h> using namespace std; unordered_map<char,int> m = {{'D',0},{'O',0},{'G',9},{'B',8},{'L',7},{'q...
dp
2019-10-05
0
642
luogu P5322
贪心+dp #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; //贪心+dp const int ma...
dp
2019-10-01
0
497
luogu p2224
产品加工 题目描述某加工厂有A、B两台机器,来加工的产品可以由其中任何一台机器完成,或者两台机器共同完成。由于受到机器性能和产品特性的限制,不同的机器加工同一产品所需的时间会不同,若同时由两台机器共同进行加工,所完成任务又会不同。某一天,加工厂接到n个产品加工的任务,每个任务的工作量不尽一样。 你的...
dp
2019-09-30
0
556
p3891 [GDOI2014]采集资源
自己刚开始的想法:一开始就想用最短路做,因为感觉不知道如何表示多维度状态。通过这道题,发现处理多维状态能用的方式自己总结了下: 多个动态规划结合,优化掉状态,实现O(1)的转移 切换dp的角度,类似本题从dp资源切换到了dp最大生产力。代码: #include <iostream> ...
dp
2019-09-29
0
731
cf577b modulo sum
代码: // // Created by 徐志远 on 2019-09-28. // #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #inc...
dp
2019-09-29
0
865
首页
上一页
1
2
3
下一页
末页