上一页 1 2 3 4 5 6 ··· 10 下一页
摘要: 牛客链接 A 思路 掌握 x^0=x 这个性质就可以秒了 题解 #include <bits/stdc++.h> using namespace std; const int N=1e5+10; typedef long long ll; int t,n; int k; int main() { i 阅读全文
posted @ 2025-08-17 22:42 屈臣 阅读(68) 评论(0) 推荐(0)
摘要: 比赛链接 总体总结 A,B题纯模拟 C题 公式一步转换 D题 五题里面最难的,dp预处理+二分 E题 排序+BFS 题解 A题 A Substring #include <bits/stdc++.h> using namespace std; const int N=1e5+10; typedef 阅读全文
posted @ 2025-08-03 12:41 屈臣 阅读(91) 评论(0) 推荐(0)
摘要: 测试链接 测试链接2 思路 其实有依赖的背包可以看成一个状况更复杂的01背包问题,01背包只需要考虑装和不装,有依赖的背包,如这个模板,就是考虑装主件,还是不装主件,装主件的话要装几个附件,因此,实际看代码可以发现就是多加了几个if条件分支,仅此而已 题解 #include <bits/stdc++ 阅读全文
posted @ 2025-08-02 15:41 屈臣 阅读(7) 评论(0) 推荐(0)
摘要: 01背包模板 测试链接 #include <bits/stdc++.h> const int N = 10000; using namespace std; int dp[10001]; int v[N],w[N]; int main() { int t,m; cin>>t>>m; for(int 阅读全文
posted @ 2025-08-02 15:01 屈臣 阅读(40) 评论(0) 推荐(0)
摘要: 测试链接:https://www.luogu.com.cn/problem/P8776 P8776 [蓝桥杯 2022 省 A] 最长不下降子序列 题目描述 给定一个长度为 \(N\) 的整数序列:\(A_{1}, A_{2}, \cdots, A_{N}\)。现在你有一次机会,将其中连续的 \(K 阅读全文
posted @ 2025-08-01 15:24 屈臣 阅读(14) 评论(0) 推荐(0)
摘要: 牛客测试地址:https://www.nowcoder.com/practice/aaefe5896cce4204b276e213e725f3ea 思路: 考虑使用二维动态规划来解。首先先把节点为0,高度不超过m的情况下,不难发现,方案数为1,所以我们初始化节点为0,高度从0~m的情况的方案,接下来 阅读全文
posted @ 2025-07-28 20:02 屈臣 阅读(15) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P2910 题解 #include <bits/stdc++.h> using namespace std; const int N=1e5+10; typedef long long ll; int t,n; int m; 阅读全文
posted @ 2025-07-28 19:55 屈臣 阅读(8) 评论(0) 推荐(0)
摘要: 题目链接:https://www.luogu.com.cn/problem/P3385 题解 #include <bits/stdc++.h> using namespace std; const int N=1e5+10; typedef long long ll; int t,n; int m; 阅读全文
posted @ 2025-07-26 13:30 屈臣 阅读(8) 评论(0) 推荐(0)
摘要: 测试链接:https://www.luogu.com.cn/problem/P4568 P4568 [JLOI2011] 飞行路线 题目描述 Alice 和 Bob 现在要乘飞机旅行,他们选择了一家相对便宜的航空公司。该航空公司一共在 \(n\) 个城市设有业务,设这些城市分别标记为 \(0\) 到 阅读全文
posted @ 2025-07-24 16:35 屈臣 阅读(65) 评论(0) 推荐(0)
摘要: leedcode测试链接:https://leetcode.cn/problems/DFPeFJ/ 题解: class Solution { public: int electricCarPlan(vector<vector<int>>& paths, int cnt, int start, int 阅读全文
posted @ 2025-07-24 15:35 屈臣 阅读(37) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 ··· 10 下一页