2012年8月1日

摘要: pku2299:http://poj.org/problem?id=2299题意:给出n个数,问要将其按从小到大排序至少需要多少步骤。解法:归并排序:将待排序集合一分为二,直至待排序集合只剩下一个元素为止,然后不断合并两个排好序的数组段。code:#include<iostream>#include<cstdio>#include<cstdlib>#include<algorithm>using namespace std;int d[500005],c[500005];__int64 ans;void msort(int l,int m,int 阅读全文
posted @ 2012-08-01 23:11 acmer-jun 阅读(225) 评论(0) 推荐(0) 编辑

导航