摘要: 我们发现我们可以直接让 $x_{i}=i$,然后模拟就行了. code: #include <cstdio> #include <cstring> #include <cmath> #include <vector> #include <map> #include <algorithm> #defi 阅读全文
posted @ 2020-02-11 15:57 EM-LGH 阅读(113) 评论(0) 推荐(0) 编辑
摘要: 用 trie 搜索一下就好了. code: #include <bits/stdc++.h> #define N 10008 #define setIO(s) freopen(s".in","r",stdin) using namespace std; char S[24]; int trie[N* 阅读全文
posted @ 2020-02-11 11:07 EM-LGH 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 滚动数组推一下就行. code: #include <bits/stdc++.h> #define setIO(s) freopen(s".in","r",stdin) using namespace std; int dp[2][4][4][4][4],n; char s[100004]; int 阅读全文
posted @ 2020-02-11 10:24 EM-LGH 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 这种多线程问题可以采用一维枚举,另一位用 dp 求解最优解来实现. 这道题和那个 ZJOI 的食堂排队的题挺像的. code: #include <bits/stdc++.h> #define ll long long #define inf 0x3f3f3f3f #define N 508000 阅读全文
posted @ 2020-02-11 10:06 EM-LGH 阅读(102) 评论(0) 推荐(0) 编辑