#include #include #include int nc, nc_clever; int compare(int **x, int a, int *p, int d){ int j; for(j=0; j p[j]) return 1; } return 0; } void vecswap(int **x, int a, int b, int d){ int j, t; for(j=0; j pivot){ nc_clever+=2; vecswap(x,low, high,d); high--; low--; } } *i = low; *j = equal - 1; } void cleversort(int **x, int l, int h, int c, int d) { if (h <= l || c == d) return; int i, j; cpartition(x, l, h, &i, &j, c, d); cleversort(x, l, j, c, d); cleversort(x, j+1, i-1, c+1, d); cleversort(x, i, h, c, d); } /*** End of Clever Quicksort ***/ int main(){ int **x, **y; int n,d; int i,j; nc = nc_clever = 0; scanf("%d %d", &d, &n); x = (int**)malloc(n*sizeof(int*)); for(i=0; i