摘要:
http://www.lydsy.com/JudgeOnline/problem.php?id=2653题目描述: 给长度为20000的序列。求左端点在[a,b]和右端点在[c,d]中所有的子序列,最大的中位数。#include #include #include #include using namespace std;const int N = 20005;struct info{ int sum, mxl, mxr; info(){} info(int val){ sum = mxl = mxr = val; }};info operator + (... 阅读全文
摘要:
#include #include #include #include #include using namespace std;const int maxm = 16;const int maxn = 1 e[maxn]; int d[maxn],p[maxn][maxm]; void dfs_(int v,int f) { p[v][0] = f; for(int i=1;i d[b]) { swap(a , b); } b = up_(b , d[b]-d[a]); if(a == ... 阅读全文