上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 题目:https://www.luogu.com.cn/problem/P1091 思路: 相当于要求最长先升后降的序列 拆开来看,先从左到右求一遍最长不下降子序列 再从右到左求一遍最长不下降子序列 再枚举求最大值 #include<stdio.h> #include<algorithm> usin 阅读全文
posted @ 2021-07-28 17:01 废柴废柴少女 阅读(44) 评论(0) 推荐(0)
摘要: 题目: https://www.luogu.com.cn/problem/P1144 用bfs来求最短路,用dep数组来表示深度,用c数组来表示从1到达当前状态的数量 如果当前的dep[w]==dep[te]+1的话就把到达te的次数加给w 代码: #include<stdio.h> #includ 阅读全文
posted @ 2021-07-27 20:54 废柴废柴少女 阅读(52) 评论(0) 推荐(0)
摘要: 题目: https://www.luogu.com.cn/problem/P1439 离散化+最长公共子序列的优化 离散化的例子:求2314 和3142的最长公共子序列2 3 1 4 1 2 3 4 3 1 4 2 2 3 4 1 #include<stdio.h> #include<algorit 阅读全文
posted @ 2021-07-27 20:23 废柴废柴少女 阅读(36) 评论(0) 推荐(0)
摘要: 题目: https://www.luogu.com.cn/problem/P2758 代码: //#define DEBUG #include<iostream> #include<stdio.h> #include<cstring> #include<math.h> #include<algori 阅读全文
posted @ 2021-07-27 14:36 废柴废柴少女 阅读(17) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1115 贪心 #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; const int inf=0x3f3f3f3f; cons 阅读全文
posted @ 2021-07-20 17:50 废柴废柴少女 阅读(31) 评论(0) 推荐(0)
摘要: 01串枚举行,贪心列 #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int a[20][20],b[20],sh[20],sl[20]; int n,m,k; long long ans=0 阅读全文
posted @ 2021-07-20 15:23 废柴废柴少女 阅读(57) 评论(0) 推荐(0)
摘要: 题目: https://www.luogu.com.cn/problem/P2678 第一行包含三个整数 L,N,ML,N,M,分别表示起点到终点的距离,起点和终点之间的岩石数,以及组委会至多移走的岩石数。保证 L \geq 1L≥1 且 N \geq M \geq 0N≥M≥0。 接下来 NN 行 阅读全文
posted @ 2021-07-16 20:57 废柴废柴少女 阅读(57) 评论(0) 推荐(0)
摘要: dfs+剪枝 #include<stdio.h> #include<algorithm> using namespace std; typedef long long ll; ll f[1007],s[1007]; ll ans=0; int n; ll c; void dfs(int index, 阅读全文
posted @ 2021-07-16 15:06 废柴废柴少女 阅读(29) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1605#submit dfs ,初始位置的v要标记 bfs在用d[ ]判断能不能到达时是要把起点拿出来单独 搜索https://www.luogu.com.cn/training/85494#problems 阅读全文
posted @ 2021-07-16 11:22 废柴废柴少女 阅读(87) 评论(0) 推荐(0)
摘要: 题目: https://www.luogu.com.cn/problem/P1024 题目描述 有形如:a x^3 + b x^2 + c x + d = 0ax3+bx2+cx+d=0 这样的一个一元三次方程。给出该方程中各项的系数(a,b,c,da,b,c,d 均为实数),并约定该方程存在三个不 阅读全文
posted @ 2021-07-15 09:58 废柴废柴少女 阅读(546) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页