diff --git a/POJ/1007.cpp b/POJ/1007.cpp new file mode 100644 index 0000000..add6e31 --- /dev/null +++ b/POJ/1007.cpp @@ -0,0 +1,72 @@ +#include +#include +#include +using namespace std; +typedef struct +{ + int inversion; + char* pointer_to_string; +}pack; +pack list[105]; + +char data[105][64]; + + +void quicksort(pack* a,int left,int right) +{ + if(left>=right) return; + int keyvalue=a[left].inversion; + int i=left,j=right; + while(i=keyvalue) + { + j--; + } + while(ilist[i].pointer_to_string[j]) + { + inversion++; + } + } + } + list[i].inversion=inversion; + } + quicksort(list,0,max-1); + for(int i=0;i