摘要:
就是求逆序数,用归并排序的过程中记录逆序数,注意结果超出了int的范围,要选用long long或其他类型的变量存储逆序数。View Code 1 #include <iostream> 2 #include <vector> 3 using namespace std; 4 5 long long sum; 6 7 void show(vector<int> a) 8 { 9 int i;10 cout<<"************"<<endl;11 for(i=0;i<a.size();i++)12 c 阅读全文
posted @ 2012-06-06 12:40
vpanda
阅读(135)
评论(0)
推荐(0)

浙公网安备 33010602011771号