上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 33 下一页
摘要: 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 4 string s[30][10]; 5 int ans[1007][1007]; 6 int num[1007]; 7 string t 阅读全文
posted @ 2020-02-03 15:00 sewage 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 预处理把左集划分为大小为1~i-1时,把全部元素都移动到右集的代价,记作sum[i]。 然后枚举终态时左集的大小,更新把元素i 留在/移动到 左集的代价。 树状数组/线段树处理区间修改/区间查询 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc+ 阅读全文
posted @ 2020-01-31 00:27 sewage 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 二维状压写成一维状压,省略加上第i条边这一维 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 4 vector<pair<int,int> >v[57]; 5 long long dp[1 阅读全文
posted @ 2020-01-29 18:01 sewage 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 完全背包,价值取题意代价的最小值 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 4 int a[10007],b[10007],f[10007]; 5 int main(){ 6 ios 阅读全文
posted @ 2020-01-27 15:25 sewage 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 应该也可以用线段树/树状数组区间更新怪兽的生命值来做 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 4 long long pre[200007]; 5 int main(){ 6 io 阅读全文
posted @ 2020-01-27 15:23 sewage 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 构造边权,从0开始给边赋值,初始选取一条边权为0,每次赋值的贡献为这一条链两侧的结点(包含链的端点)个数之积,下一次赋值以当前链其一端点续一条边,边权为上次赋的值+1。先DFS找到点的组合这条链两侧结点的个数(包含链的端点),然后枚举端点进行DP。 1 #define HAVE_STRUCT_TIM 阅读全文
posted @ 2020-01-25 22:57 sewage 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 4 int mn[600007],mx[600007],a[600007],pos[600007],sum[600007]; 5 int n 阅读全文
posted @ 2020-01-16 21:33 sewage 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 这题1<<M为255,可以logN二分答案后,N*M扫一遍表把N行数据转化为一个小于等于255的数字,再255^2检验答案(比扫一遍表复杂度低),复杂度约为N*M*logN 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 usin 阅读全文
posted @ 2020-01-16 12:53 sewage 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 沿时间轴枚举,发现关键时间点在于新题目被锁定的前一时间,那是新的题目还没有被锁定并且距离旧的题目已经被锁定的最晚时间,对这些时间点进行操作 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 阅读全文
posted @ 2020-01-15 17:02 sewage 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 1 #define HAVE_STRUCT_TIMESPEC 2 #include<bits/stdc++.h> 3 using namespace std; 4 const long long mod = 1e9+7; 5 long long pre[1007][1007],temp[1007][ 阅读全文
posted @ 2020-01-15 12:42 sewage 阅读(167) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 33 下一页