codeforces645B】的更多相关文章

Mischievous Mess Makers CodeForces - 645B It is a balmy spring afternoon, and Farmer John's n cows are ruminating about link-cut cacti in their stalls. The cows, labeled 1 through n, are arranged so that the i-th cow occupies the i-th stall from the…
题意: 给你1-n的序列,然后有k次机会的操作,每一次你可以选择两个数交换. 求一个最大的逆序数. 思路: 感觉就是最后一个和第一个交换,然后往中间逼近,到最终的序列,用树状数组求一下逆序数. #include <iostream> #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; #define MAX 100010 typedef __int6…