Find the median 题目链接: https://ac.nowcoder.com/acm/contest/887/E 题目描述 Let median of some array be the number which would stand in the middle of this array if it was sorted beforehand. If the array has even length let median be smallest of of two middl
Find the median 题意 刚开始集合为空,有n次操作,每次操作往集合里面插入[L[i],R[i]]的值,问每次操作后中位数是多少 分析 由于n比较大,并且数可以达到1e9,我们无法通过权值线段树来进行操作,那么怎么办呢?题目中还有什么性质?插入的值是一段一段的,那么我们是不是能从这些段中入手?维护这些段,怎么维护呢,如果[1,2][2,5]这两段有一个点重合那该怎么办,此时我们可以用一个常规操作把r加1进行分段,什么意思呢例如上例我们分成[1,2][2,3][3,6]那么我们对[1,
链接:https://www.nowcoder.com/acm/contest/145/C来源:牛客网 A binary string s of length N = 2n is given. You will perform the following operation n times : - Choose one of the operators AND (&), OR (|) or XOR (^). Suppose the current string is S = s1s2...sk.
链接:https://ac.nowcoder.com/acm/contest/884/A来源:牛客网 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 524288K,其他语言1048576K 64bit IO Format: %lld 题目描述 A new city has just been built. There're nnn interesting places numbered by positive numbers from 111 to nnn. In order