摘要: #include <iostream> #include <cstring> #include <cmath> using namespace std; using ll=long long ; const int maxn=1e3+10; const int mod=1e6+3; int dp[m 阅读全文
posted @ 2021-05-17 19:14 Acception 阅读(191) 评论(0) 推荐(0)
摘要: #include <cstring> #include <cstdio> #define max(a,b) a>b?a:b const int mn=300005; struct Trie{ int father,fail,next[26]; void init(){ father=fail=0; 阅读全文
posted @ 2021-05-17 17:42 Acception 阅读(502) 评论(0) 推荐(0)
摘要: D题就是个搜索居然没有发现 题目大意:先输入一个数n,在输入n个数由0 1构成,从1到0的价值是它们下表差的绝对值,问将所有的1移动到0的最小价值总和是多少(1不能移动到前一个1移走的位置)。 题解:将输入的0和1分别用两个向量存它们的下标 贪心1向量中只能从对应0向量位置向右走深搜 先走到底记录下 阅读全文
posted @ 2021-05-17 16:58 Acception 阅读(51) 评论(0) 推荐(0)