hdu2443conter strike-算法效率优化(求“正序对”)
#include
#define MAX 100005
int sum[MAX],tmp[MAX];
_int64 ans;
void merge(int l,int m,int r){
int h1=l,h2=m+1,tmp_num=l,i;
while(h1<=m&&h2<=r){
if(sum[h2]>sum[h1]) tmp[tmp_num++]=sum[h1++],ans+=r-
原创
2014-09-20 11:16:57 ·
808 阅读 ·
0 评论