上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 45 下一页
摘要: E13 背包DP 多重背包 单调队列优化——信息学奥赛算法_哔哩哔哩_bilibili E11【模板】单调队列 滑动窗口最值 - 董晓 - 博客园 P1776 宝物筛选 - 洛谷 // 单调队列 O(n*W) #include<bits/stdc++.h> using namespace std; 阅读全文
posted @ 2023-04-10 09:57 董晓 阅读(1166) 评论(0) 推荐(3)
摘要: E12 单调队列 最大连续和_哔哩哔哩_bilibili U162981 最大连续和 - 洛谷 f[i]表示选第 i 个数,且长度不超过m的最大连续和f[i] = max(s[i]-s[j]) = s[i]-min(s[j]), i-m<=j<=i-1,s为前缀和 // 单调队列 O(n) #inc 阅读全文
posted @ 2023-04-10 09:56 董晓 阅读(967) 评论(2) 推荐(2)
摘要: E11【模板】单调队列 滑动窗口最值_哔哩哔哩_bilibili P1886 滑动窗口 /【模板】单调队列 - 洛谷 // 单调队列 O(n) #include<iostream> using namespace std; const int N=1000010; int n,k,a[N],q[N] 阅读全文
posted @ 2023-04-10 09:24 董晓 阅读(1729) 评论(0) 推荐(5)
摘要: E10 背包DP 多重背包 二进制优化——信息学奥赛算法_哔哩哔哩_bilibili #include <iostream> #include <algorithm> using namespace std; const int N=210; int n, m; int v[N], w[N], s[ 阅读全文
posted @ 2023-04-10 09:23 董晓 阅读(1216) 评论(1) 推荐(1)
摘要: E09【模板】背包DP 完全背包_哔哩哔哩_bilibili U227266 完全背包问题 - 洛谷 // 朴素算法 TLE #include <iostream> #include <algorithm> using namespace std; const int N=1010; int n, 阅读全文
posted @ 2023-04-10 09:22 董晓 阅读(1134) 评论(0) 推荐(3)
摘要: E08【模板】背包DP 01背包_哔哩哔哩_bilibili U225269 01背包问题 - 洛谷 P2871 [USACO07DEC] Charm Bracelet S - 洛谷 // 朴素算法 MLE #2 #10 #include <iostream> #include <cstring> 阅读全文
posted @ 2023-04-10 09:20 董晓 阅读(1536) 评论(0) 推荐(1)
摘要: E07 线性DP 编辑距离_哔哩哔哩_bilibili P2758 编辑距离 - 洛谷 // 线性DP O(n^2) #include<bits/stdc++.h> using namespace std; const int N=2010; char a[N],b[N]; int n,m,f[N] 阅读全文
posted @ 2023-04-10 09:19 董晓 阅读(969) 评论(0) 推荐(1)
摘要: E06 线性DP 最长公共子串_哔哩哔哩_bilibili T493246 最长公共子串 - 洛谷 // 线性DP O(n^2) #include<bits/stdc++.h> using namespace std; const int N=1005; char a[N],b[N]; int n, 阅读全文
posted @ 2023-04-10 09:17 董晓 阅读(853) 评论(0) 推荐(1)
摘要: E05 线性DP 最长公共子序列_哔哩哔哩_bilibili U197280 【模板】最长公共子序列 - 洛谷 // 线性DP O(n^2) #include<bits/stdc++.h> using namespace std; const int N=1010; int n,m; char a[ 阅读全文
posted @ 2023-04-09 23:12 董晓 阅读(1181) 评论(1) 推荐(1)
摘要: E04 线性DP 最长上升子序列 二分优化_哔哩哔哩_bilibili B3637 最长上升子序列 - 洛谷 // 二分+贪心 O(nlogn) #include<bits/stdc++.h> using namespace std; const int N=100010; int n,a[N]; 阅读全文
posted @ 2023-04-09 22:25 董晓 阅读(1172) 评论(1) 推荐(4)
上一页 1 ··· 27 28 29 30 31 32 33 34 35 ··· 45 下一页