随笔分类 - 单调队列
摘要:Problem DescriptionYou are given a necklace consists of N beads linked as a circle. Each bead is either crystal or jade.Now, your task is:1.Choose an arbitrary position to cut it into a chain.2.Choose either direction to collect it.3.Collect all the beads in the chosen direction under the constraint
阅读全文
摘要:DescriptionAn array of size n ≤ 106 is given to you. There is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves rightwards by one position. Following is an example: The array
阅读全文
摘要:Problem DescriptionGiven a circle sequence A[1],A[2],A[3]......A[n]. Circle sequence means the left neighbour of A[1] is A[n] , and the right neighbour of A[n] is A[1].Now your job is to calculate the max sum of a Max-K-sub-sequence. Max-K-sub-sequence means a continuous non-empty sub-sequence which
阅读全文

浙公网安备 33010602011771号