题目: 给你一个01串,现在你可以(或者不用)选取其中一个元素进行一次反转操作0-1,1-0;从而使得串中的逆序对个数最多。 题目链接:codeforce origin problem 思路: 1. 如何统计逆序对的个数? 从后向前扫描...
Array Partition You are given an array a consisting of n integers. Let min(l,r) be the minimum value among al,al+1,…,ar and max(l,r) be the maximum value among al,al+1,…,ar. Your task is ...