From 1b10af590301bd513c228d71924f625b24db3f36 Mon Sep 17 00:00:00 2001 From: Kirito <1362050620@qq.com> Date: Fri, 28 Oct 2016 20:38:10 +0800 Subject: [PATCH] Mid-Judge Success !!!!!! Special Judge : Mid Judge Success Today ! --- QUSTOJ/1876.cpp | 72 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 QUSTOJ/1876.cpp 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