摘要: Mushroom的区间【题目描述】Mushroom有一行数,初始时全部是0。现在Mushroom有m个区间[L,R],他希望用以下操作得到新的序列。从m个给定区间中选择一个区间[s,t],把区间中的数对应元素全部翻转。(0变1,1变0)请告诉Mushroom他能得到多少区间。(模10^9+7)【输入 阅读全文
posted @ 2016-10-31 19:08 love★maple 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目大意:给长度N的A1.....An 求(Ai-Aj)MAX枚举n^2 其实动态维护最大值就好了#include #include using namespace std; int t,a[100005],n,ans,MAX; int main() { scanf("%d",&t); while (t--) { scanf("%d",&n); ... 阅读全文
posted @ 2016-10-30 19:30 love★maple 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 第一次写树剖~#include #include #include #define L(u) u>1; if (locdepth[d[i][1]]) swap(d[i][0],d[i][1]);//make the higher depth node to map the Edge update(1,1,tot2,w[d[i][1]],d[i][2]); //chang... 阅读全文
posted @ 2016-10-25 16:38 love★maple 阅读(130) 评论(0) 推荐(0) 编辑