Maximum Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1450    Accepted Submission(s): 673 Sample Input 4 8 11 8 5 3 1 4 2 Sample Output 27 Hint For the first sample: 1. Choose 2 from…
/* HDU 6047 - Maximum Sequence [ 单调队列 ] 题意: 起初给出n个元素的数列 A[N], B[N] 对于 A[]的第N+K个元素,从B[N]中找出一个元素B[i],在 A[] 中找到一个数字A[p]满足 B[i] <= p <= N+K-1 令 A[N+K] = A[p]-p,直到A[]的长度等于2N 问 A[N+1] + A[N+2] + ... + A[N<<1] 最大是多少 分析: 将A[]中元素全部减去其下标 将B[]排序,可分析一定是从小…
Funny Function Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1109    Accepted Submission(s): 527 Sample Input 2 2 2 3 3 Sample Output 2 33 Source 2017 Multi-University Training Contest - Team…
TrickGCD Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 2097    Accepted Submission(s): 816 Sample Input 1 4 4 4 4 4 Sample Output Case #1: 17   Source 2017 Multi-University Training Contest…
Maximum Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1152    Accepted Submission(s): 537 Problem Description Steph is extremely obsessed with “sequence problems” that are usually see…
题目网址:http://acm.hdu.edu.cn/showproblem.php?pid=6047 题目: Maximum Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 90    Accepted Submission(s): 44 Problem Description Steph is extremely o…
题目网址:http://acm.hdu.edu.cn/showproblem.php?pid=6047 题目: Maximum Sequence Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 90    Accepted Submission(s): 44 Problem Description Steph is extremely o…
Regular polygon Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2004    Accepted Submission(s): 795 Problem Description On a two-dimensional plane, give you n integer points. Your task is to fig…
[链接]点击打开链接 [题意] 询问n个点的完全k叉树,所有子树节点个数的异或总和为多少. [题解] 考虑如下的一棵k=3叉树,假设这棵树恰好有n个节点. 因为满的k叉树,第i层的节点个数为k^(i-1); 则我们找到最大的d; 使得 k^0+k^1+..+k^(d-1) <=n 自此,我们会发现,整棵树可以分成若干个树的深度大小为d和d-1的满k叉树. 如上图,d=3,两个圈起来的,就是一个深度为3的满k叉树和一个深度为2的满k叉树. 当然,还可能会有一个子树,它不是满的k叉树. 如上图中没有…
[链接]h在这里写链接 [题意] 给你一棵树,每个节点上都有一个权值. 然后给你m个询问,每个询问(x,y,a,b); 表示询问x->y这条路径上权值在[a,b]范围内的节点的权值和. [题解] 树链剖分题. 在树链上建一个线段树,线段树的每个节点存3个值,max[i],min[i],sum[i]分别表示这个区间里面的数的最大值.最小值.以及权值和. 然后在线段树上做查找(a,b)范围内的数的权值和. 如果该节点在路径上,那么如果a<=min[i] && max[i] <…