diff --git a/QUSTOJ/1876.cpp b/QUSTOJ/1876.cpp new file mode 100644 index 0000000..6271405 --- /dev/null +++ b/QUSTOJ/1876.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