上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 37 下一页
摘要: 题目传送门 数位dp. #include<iostream> #include<cstdio> #include<cstring> #define mod 1000000007 using namespace std; string l,r; int a[1005],b[1005],f[1005][ 阅读全文
posted @ 2020-09-02 23:04 Mr^Simon 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 数位dp,没啥好说的 #include<iostream> #include<cstdio> #include<cstring> #define mod 1000000007 using namespace std; int t,s[20],len; long long l,r,ans, 阅读全文
posted @ 2020-09-02 22:59 Mr^Simon 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 从最后倒着往前推,贪心模拟即可 #include<iostream> #include<cstdio> #include<vector> #include<queue> using namespace std; int m,n,ti,o[501],ans; vector<int> a[5 阅读全文
posted @ 2020-09-02 22:58 Mr^Simon 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 一开始没看到题目下面的说明(只能走直线),推了好长时间没推出来.f[i][j]表示从(0,0)到(i,j)的最大矿数. #include<iostream> #include<cstdio> #include<cstring> using namespace std; int n,m,a 阅读全文
posted @ 2020-09-02 22:54 Mr^Simon 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 区间DP,f[i][j]表示i~j区间最小答案,用ans[i][j]记录f[i][j]的断点在哪里,即括号分界处. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namesp 阅读全文
posted @ 2020-09-02 21:43 Mr^Simon 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 分层图最短路,或者说是一个DP,f[i][j]表示用了i张免费券,到了j号点的最小花费,然后跑最短路 #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; in 阅读全文
posted @ 2020-09-02 21:14 Mr^Simon 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 解题思路: 在搜的时候,出现个数作为一个参量,实时更新,到时直接传就行 AC代码: 1 #include<cstdio> 2 #include<iostream> 3 #include<cstring> 4 #include<cmath> 5 6 using namespace std; 阅读全文
posted @ 2020-08-11 23:42 Mr^Simon 阅读(87) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 解题思路: 搜的时候记录8,4和三连就行. AC代码: 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 5 using namespace std; 6 7 long long l,r; 8 int s[15], 阅读全文
posted @ 2020-08-11 23:40 Mr^Simon 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 解题思路: 简单的数位DP,注意处理好前导0就行. AC代码: 1 #include<iostream> 2 #include<cstdio> 3 #include<cmath> 4 #include<algorithm> 5 #include<cstring> 6 7 using na 阅读全文
posted @ 2020-08-11 23:38 Mr^Simon 阅读(80) 评论(0) 推荐(0) 编辑
摘要: 题目传送门 解题思路: 如果一个软件被卸载,那答案就是它所有已安装的子孙的个数;如果安装,就是它到根的链上没安装的个数.(注意修改lazy的时候) AC代码: 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #include 阅读全文
posted @ 2020-08-11 23:36 Mr^Simon 阅读(120) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 37 下一页