- 博客(2)
- 收藏
- 关注
原创 poj2388
数据貌似很弱的样子,冒泡也可以过,用线性时间查找第k个数,0ms过。 #include #include #define MAXD 10010 int N,a[MAXD]; int partition(int a[],int p,int r) { int x=a[r]; int i=p-1; int j,t; for(j=p;j<r;j++) {
2012-10-12 21:20:32 176
原创 poj1804
用归并排序求逆序对。 不过数据好弱,貌似冒泡也不会超时,类似的题目有poj2299. #include #include int Sce,N; long long A[1010],L[1010],R[1010],cnt; void merge(long long a[],int x,int m,int y) { int n1=m-x+1; int n2=y-m; i
2012-10-10 13:58:00 126
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人