上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 35 下一页
摘要: 题意:给定n,p,k n个数,然后取连续的一段,让着一段的sum%p<=k,然后求满足条件的最大sum/p 思路:见注释 /* 取一段[L,R]让这个区间和取模后小于等于k 切记,取模操作符合减法的分配定律 条件可以转化为(sum-pre[L]-suf[R])%p<=k >(sum%p-pre[L] 阅读全文
posted @ 2019-11-16 20:50 starve_to_death 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 题:https://codeforces.com/contest/1257/problem/E 题意:给定3个数组,可行操作:每个数都可以跳到另外俩个数组中去,实行多步操作后使三个数组拼接起来形成升序。 输出最小操作次数 dp: #include<bits/stdc++.h> using names 阅读全文
posted @ 2019-11-15 10:42 starve_to_death 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 这是对点权计算的板子 #include<bits/stdc++.h> using namespace std; #define lson root<<1,l,midd #define rson root<<1|1,midd+1,r #define pb push_back typedef long 阅读全文
posted @ 2019-11-13 12:49 starve_to_death 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 题:https://codeforces.com/contest/1016/problem/D 题意:有一个 n * m 的矩阵, 现在给你 n 个数, 第 i 个数 a[ i ] 代表 i 这一行所有数的抑或和。 再给你 m 个数, 第 i 个数 b[ i ] 代表 i 这一列 所有数的抑或和。 阅读全文
posted @ 2019-11-11 23:56 starve_to_death 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 题:https://codeforces.com/contest/1027/problem/E 题意:给定n*n的方格,可以染黑白,要求相邻俩行”完全“不同或完全相同,对于列也是一样。然后限制不能拥有k面积具有相同颜色的格子 分析: #include<bits/stdc++.h> using nam 阅读全文
posted @ 2019-11-11 12:52 starve_to_death 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 解释:先留坑 题目:https://www.cometoj.com/contest/73/problem/D?problem_id=4120 #include<bits/stdc++.h> using namespace std; #define se set<aa> #define it iter 阅读全文
posted @ 2019-11-11 00:10 starve_to_death 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 题:https://codeforces.com/contest/1243/problem/D 分析:找全部可以用边权为0的点连起来的全部块 然后这些块之间相连肯定得通过边权为1的边进行连接 所以答案就是这些块的总数-1; #include<bits/stdc++.h> using namespac 阅读全文
posted @ 2019-11-07 18:07 starve_to_death 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 题:https://codeforces.com/contest/1245/problem/F 分析:转化为:求区间内满足a&b==0的对数(解释见代码) ///求满足a&b==0在区间【l,r】的对数 ///推导:区间[2l,2r]可由[l,r]乘3倍得来 ///原因:*2我们可以看成事左移1位, 阅读全文
posted @ 2019-11-06 22:32 starve_to_death 阅读(168) 评论(0) 推荐(0) 编辑
摘要: E:https://codeforces.com/contest/1088/problem/E dp+贪心 题目大意:选择一个k并且选择k个连通块,要求sigma a[i]/k最大,k尽量大,对于给定的一颗树,输出最大的分数,不用约分的形式。题目意思需要进一步解析,假定有一个最大的连通块,那么根据贪 阅读全文
posted @ 2019-11-06 14:26 starve_to_death 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 题:https://codeforces.com/contest/1256/problem/E 题意:给一些值,代表队员的能力值,每组要分3个或3个以上的人,然后有个评价值x=(队里最大值-最小值),问最小的∑x是多少,以及输出方案 学习粗:https://www.cnblogs.com/Lubix 阅读全文
posted @ 2019-11-05 22:10 starve_to_death 阅读(220) 评论(0) 推荐(0) 编辑
上一页 1 ··· 19 20 21 22 23 24 25 26 27 ··· 35 下一页