勤劳的小蜗牛许愿简历通过
勤劳的小蜗牛许愿简历通过
全部文章
分类
归档
标签
去牛客网
登录
/
注册
勤劳的小蜗牛许愿简历通过的博客
全部文章
(共83篇)
题解 | #装箱问题#
#include <algorithm> #include <iostream> using namespace std; const int N = 2 * 10010; int a[N], f[N]; int main() { int m, n; cin...
2024-11-08
1
58
题解 | #分割等和子集#
如果能分成相等的两份的话,那么sum一定是偶数1.sum是奇数的话 就false2.如果是偶数 就变成了0-1背包问题 求数组和是否有和为sum / 2的子数组 有就是true3.没有就false #include <algorithm> #include <iostream>...
2024-11-08
2
79
题解 | #兑换零钱#
#include <algorithm> #include <cstring> #include <iostream> using namespace std; const int N = 10010; int f[N], a[N]; int main() {...
2024-11-08
0
58
题解 | #最少的完全平方数#
1.比如说f[14] = f[9] + f[4] + f[1] = 3f[9] = 1 故 f[14] = 1 + f[14 - 9] = 1 + f[5] = 1 + f[4] + f[1]可以得到f[n] = f[n - j * j] + 1这个状态又例如f[13] = f[9] + f[4] ...
2024-11-08
0
31
题解 | #【模板】完全背包#
#include <algorithm> #include <cstring> #include <iostream> using namespace std; const int N = 1010; int f[N], w[N], v[N]; int mai...
2024-11-08
0
29
题解 | #【模板】01背包#
求背包容量恰好被装满时,最大价值为多少?需要将数组设置为很小的负数,这样表示状态不可达设置f[0] = 0表示背包容量为0是物体价值为0,初始化 #include <algorithm> #include <cstring> #include <iostream>...
2024-11-08
0
50
题解 | #[NOIP2002 普及组] 过河卒#
#include <iostream> using namespace std; // b点坐标和马的坐标 int xb, yb, xh, yh; // h为能否走的表示 long long h[30][30] = {0}, f[30][30] = {0}; int main() {...
2024-11-07
0
45
题解 | #有多少个不同的二叉搜索树#
#include <cstring> #include <iostream> using namespace std; int main() { int n; cin >> n; int f[n + 1]; memset(f, 0...
2024-11-07
0
28
题解 | #乘积为正数的最长连续子数组#
#include <cstring> #include <iostream> using namespace std; int main() { int n; cin >> n; int a[n], f[n], g[n]; for...
2024-11-07
0
44
题解 | #信封嵌套#
#include <algorithm> #include <iostream> #include<vector> #include<cstring> using namespace std; int main() { int n; c...
2024-11-07
0
30
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页