上一页 1 ··· 6 7 8 9 10 11 12 下一页

P1616 疯狂的采药

摘要: 题面: 链接:https://www.luogu.com.cn/problem/solution/P1616 类型:完全背包模板 完全背包感觉也可以用普通的0/1背包去写,但是似乎时间不够? 总之这种题目的模板就是一个一维数组dp,然后空间从t[i]遍历到times,这样可以实现多个t[i]相加 这 阅读全文
posted @ 2024-04-04 09:48 WHUStar 阅读(1) 评论(0) 推荐(0) 编辑

P1002 [NOIP2002 普及组] 过河卒

摘要: emmmm...据说是比较简单的dp?(再一次意识到自己的菜) 链接:https://www.luogu.com.cn/problem/P1002 题目: 总的思路就是一个状态转移方程吧: dp[x][y] = dp[x-1][y] + dp[x][y-1]; 然后如果发现这个点不能通过,那么强制修 阅读全文
posted @ 2024-04-03 22:19 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑

P1802 5 倍经验日

摘要: 链接:https://www.luogu.com.cn/problem/P1802 额,dp的板子?差不多,就加一个变式就行( 代码: #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include< 阅读全文
posted @ 2024-04-03 21:42 WHUStar 阅读(1) 评论(0) 推荐(0) 编辑

P1434 [SHOI2002] 滑雪

摘要: 链接:https://www.luogu.com.cn/problem/P1434 题目: 思路:找每个点的小于链的长度,存在lenless里;找每个点的大于链,存在于lengreat中。 然后两个相加,排序,选择最大的那个数字。注意这里长度要加1,因为没有加上自己的(初始数据设置成0)! (按理说 阅读全文
posted @ 2024-04-03 15:32 WHUStar 阅读(4) 评论(0) 推荐(0) 编辑

kmp板子

摘要: 书上讲的感觉不好理解,不如算法竞赛上分析的 题目链接: https://www.luogu.com.cn/problem/P3375 贴板子: #include<iostream> #include<vector> #include<algorithm> #include<math.h> #incl 阅读全文
posted @ 2024-04-02 12:16 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑

图论割点模板

摘要: #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<sstream> #include<string> #include<string.h> #include<iomanip> #incl 阅读全文
posted @ 2024-04-01 22:11 WHUStar 阅读(1) 评论(0) 推荐(0) 编辑

拓扑排序的模板

摘要: 拓扑排序的模板,csdn:https://blog.csdn.net/weixin_43872728/article/details/98981923 #include <iostream> #include <vector> #include <cstdio> #include <queue> # 阅读全文
posted @ 2024-03-31 17:01 WHUStar 阅读(3) 评论(0) 推荐(0) 编辑

图论板子

摘要: 链式前向星的存储模板 #include<iostream> #include<vector> #include<algorithm> #include<math.h> #include<sstream> #include<string> #include<string.h> #include<iom 阅读全文
posted @ 2024-03-31 16:43 WHUStar 阅读(1) 评论(0) 推荐(0) 编辑

A1. Oh Sweet Beaverette

摘要: https://codeforces.com/contest/331/problem/A1 关键点: 前缀和,记录每个负数的位置,以及变式前缀和(只记录正数) #define _CRT_SECURE_NO_WARNINGS 1 #include<iostream> #include<vector> 阅读全文
posted @ 2024-03-26 22:34 WHUStar 阅读(5) 评论(0) 推荐(0) 编辑

IndiaHacks 2nd Elimination 2017A. Binary Blocks

摘要: https://codeforces.com/contest/838/problem/A 二维前缀和的应用,注意可能比较绕 然后注意边界可以拿min的替换就行 #define _CRT_SECURE_NO_WARNINGS 1 #include<iostream> #include<vector> 阅读全文
posted @ 2024-03-26 18:36 WHUStar 阅读(2) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 下一页