0_0_21573530_6436\Main.java:1: 错误: 需要class, interface或enum
importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.lang.reflect.Array;importjava.util.Comparator;importjava.util.Random;importjava.util.StringTokenizer;classMSort<T>{privatestaticfinalintMIN_LENGTH=4;privateComparator<T>comparator;privateT[]assist_array;publicMSort(Comparator<T>comparator,Class<T>classType,intsiz){this.comparator=comparator;assist_array=(T[])Array.newInstance(classType,siz);}publicMSort(Comparator<T>comparator,T[]assist_array){this.comparator=comparator;this.assist_array=assist_array;}publicvoidmergeOrderedArray(T[]A,T[]B,T[]C,intABegin,intAEnd,intBBegin,intBEnd,intCBegin){inti=ABegin,j=BBegin,k=CBegin;while(i<AEnd&&j<BEnd){if(comparator.compare(A[i],B[j])<0)C[k++]=A[i++];elseC[k++]=B[j++];}while(i<AEnd)C[k++]=A[i++];while(j<BEnd)C[k++]=B[j++];}privatevoid_sort_assist(T[]targets,intbegin,intend){for(inti=begin+1;i<end;++i){Ttarget=targets[i];intj=i-1;for(;j>=begin;--j){if(comparator.compare(targets[j],target)<=0)break;targets[j+1]=targets[j];}targets[j+1]=target;}}privatevoid_sort(T[]targets,intbegin,intend){intlength=end-begin;if(length<=MIN_LENGTH){_sort_assist(targets,begin,end);return;}intmid=begin+(length>>1);_sort(targets,begin,mid);_sort(targets,mid,end);mergeOrderedArray(targets,targets,assist_array,begin,mid,mid,end,begin);System.arraycopy(assist_array,begin,targets,begin,end-begin);}publicvoidsort(T[]targets,intoffset,intlength){intend=offset+length;assertoffset>=0&&offset<targets.length&&end<targets.length:"Out of bound of array";_sort(targets,offset,end);}}classQSort<T>{privatestaticfinalintMIN_LENGTH=4;privateRandomrandom=newRandom();privateComparator<T>comparator;publicQSort(Comparator<T>comparator){this.comparator=comparator;}privatevoid_sort_assist(T[]targets,intbegin,intend){for(inti=begin+1;i<end;++i){Ttarget=targets[i];intj=i-1;for(;j>=begin;--j){if(comparator.compare(targets[j],target)<=0)break;targets[j+1]=targets[j];}targets[j+1]=target;}}privatevoid_sort(T[]targets,intbegin,intend){if(begin+MIN_LENGTH>=end){_sort_assist(targets,begin,end);return;}intlft=begin,rht=end-1;intmid=lft+random.nextInt(end-begin);Ttarget=targets[mid];while(lft<=rht){while(comparator.compare(targets[lft],target)<0)++lft;while(comparator.compare(targets[rht],target)>0)--rht;if(lft<=rht){Ttmp=targets[lft];targets[lft]=targets[rht];targets[rht]=tmp;++lft;--rht;}}++rht;if(begin+1<rht)_sort(targets,begin,rht);if(lft+1<end)_sort(targets,lft,end);}publicvoidsort(T[]targets,intoffset,intlength){intend=offset+length;assertoffset>=0&&offset<targets.length&&end<targets.length:"Out of bound of array";_sort(targets,offset,end);}}classScanner{privateBufferedReaderreader;privateStringTokenizertokenizer;publicScanner(InputStreamin){reader=newBufferedReader(newInputStreamReader(in),32768);tokenizer=null;}publicScanner(InputStreamin,intsize){reader=newBufferedReader(newInputStreamReader(in),size);tokenizer=null;}publicbooleanhasNext(){while(tokenizer==null||!tokenizer.hasMoreTokens()){try{tokenizer=newStringTokenizer(reader.readLine());}catch(Exceptione){returnfalse;}}returntrue;}publicStringnext(){while(tokenizer==null||!tokenizer.hasMoreTokens()){try{tokenizer=newStringTokenizer(reader.readLine());}catch(Exceptione){thrownewRuntimeException(e);}}returntokenizer.nextToken();}publicintnextInt(){returnInteger.parseInt(next());}publicStringnextLine(){try{returnreader.readLine();}catch(IOExceptione){thrownewRuntimeException(e);}}}publicclassMain{privatestaticfinalScannerin=newScanner(System.in);privatestaticfinalintMAXN=1000000+10;privatestaticfinalInteger[]targets=newInteger[MAXN];privatestaticfinalQSort<Integer>sort=newQSort(newComparator<Integer>(){@Overridepublicintcompare(Integero1,Integero2){returno2-o1;}});publicstaticvoidmain(String[]args){while(in.hasNext()){intN=in.nextInt();intM=in.nextInt();for(inti=0;i<N;++i)targets[i]=in.nextInt();sort.sort(targets,0,N);System.out.print(targets[0]);for(inti=1;i<M;++i)System.out.print(" "+targets[i]);System.out.println();}}}
^
0_0_21573530_6436\Main.java:1: 错误: 需要class, interface或enum
importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.lang.reflect.Array;importjava.util.Comparator;importjava.util.Random;importjava.util.StringTokenizer;classMSort<T>{privatestaticfinalintMIN_LENGTH=4;privateComparator<T>comparator;privateT[]assist_array;publicMSort(Comparator<T>comparator,Class<T>classType,intsiz){this.comparator=comparator;assist_array=(T[])Array.newInstance(classType,siz);}publicMSort(Comparator<T>comparator,T[]assist_array){this.comparator=comparator;this.assist_array=assist_array;}publicvoidmergeOrderedArray(T[]A,T[]B,T[]C,intABegin,intAEnd,intBBegin,intBEnd,intCBegin){inti=ABegin,j=BBegin,k=CBegin;while(i<AEnd&&j<BEnd){if(comparator.compare(A[i],B[j])<0)C[k++]=A[i++];elseC[k++]=B[j++];}while(i<AEnd)C[k++]=A[i++];while(j<BEnd)C[k++]=B[j++];}privatevoid_sort_assist(T[]targets,intbegin,intend){for(inti=begin+1;i<end;++i){Ttarget=targets[i];intj=i-1;for(;j>=begin;--j){if(comparator.compare(targets[j],target)<=0)break;targets[j+1]=targets[j];}targets[j+1]=target;}}privatevoid_sort(T[]targets,intbegin,intend){intlength=end-begin;if(length<=MIN_LENGTH){_sort_assist(targets,begin,end);return;}intmid=begin+(length>>1);_sort(targets,begin,mid);_sort(targets,mid,end);mergeOrderedArray(targets,targets,assist_array,begin,mid,mid,end,begin);System.arraycopy(assist_array,begin,targets,begin,end-begin);}publicvoidsort(T[]targets,intoffset,intlength){intend=offset+length;assertoffset>=0&&offset<targets.length&&end<targets.length:"Out of bound of array";_sort(targets,offset,end);}}classQSort<T>{privatestaticfinalintMIN_LENGTH=4;privateRandomrandom=newRandom();privateComparator<T>comparator;publicQSort(Comparator<T>comparator){this.comparator=comparator;}privatevoid_sort_assist(T[]targets,intbegin,intend){for(inti=begin+1;i<end;++i){Ttarget=targets[i];intj=i-1;for(;j>=begin;--j){if(comparator.compare(targets[j],target)<=0)break;targets[j+1]=targets[j];}targets[j+1]=target;}}privatevoid_sort(T[]targets,intbegin,intend){if(begin+MIN_LENGTH>=end){_sort_assist(targets,begin,end);return;}intlft=begin,rht=end-1;intmid=lft+random.nextInt(end-begin);Ttarget=targets[mid];while(lft<=rht){while(comparator.compare(targets[lft],target)<0)++lft;while(comparator.compare(targets[rht],target)>0)--rht;if(lft<=rht){Ttmp=targets[lft];targets[lft]=targets[rht];targets[rht]=tmp;++lft;--rht;}}++rht;if(begin+1<rht)_sort(targets,begin,rht);if(lft+1<end)_sort(targets,lft,end);}publicvoidsort(T[]targets,intoffset,intlength){intend=offset+length;assertoffset>=0&&offset<targets.length&&end<targets.length:"Out of bound of array";_sort(targets,offset,end);}}classScanner{privateBufferedReaderreader;privateStringTokenizertokenizer;publicScanner(InputStreamin){reader=newBufferedReader(newInputStreamReader(in),32768);tokenizer=null;}publicScanner(InputStreamin,intsize){reader=newBufferedReader(newInputStreamReader(in),size);tokenizer=null;}publicbooleanhasNext(){while(tokenizer==null||!tokenizer.hasMoreTokens()){try{tokenizer=newStringTokenizer(reader.readLine());}catch(Exceptione){returnfalse;}}returntrue;}publicStringnext(){while(tokenizer==null||!tokenizer.hasMoreTokens()){try{tokenizer=newStringTokenizer(reader.readLine());}catch(Exceptione){thrownewRuntimeException(e);}}returntokenizer.nextToken();}publicintnextInt(){returnInteger.parseInt(next());}publicStringnextLine(){try{returnreader.readLine();}catch(IOExceptione){thrownewRuntimeException(e);}}}publicclassMain{privatestaticfinalScannerin=newScanner(System.in);privatestaticfinalintMAXN=1000000+10;privatestaticfinalInteger[]targets=newInteger[MAXN];privatestaticfinalQSort<Integer>sort=newQSort(newComparator<Integer>(){@Overridepublicintcompare(Integero1,Integero2){returno2-o1;}});publicstaticvoidmain(String[]args){while(in.hasNext()){intN=in.nextInt();intM=in.nextInt();for(inti=0;i<N;++i)targets[i]=in.nextInt();sort.sort(targets,0,N);System.out.print(targets[0]);for(inti=1;i<M;++i)System.out.print(" "+targets[i]);System.out.println();}}}
^
0_0_21573530_6436\Main.java:1: 错误: 需要class, interface或enum
importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.lang.reflect.Array;importjava.util.Comparator;importjava.util.Random;importjava.util.StringTokenizer;classMSort<T>{privatestaticfinalintMIN_LENGTH=4;privateComparator<T>comparator;privateT[]assist_array;publicMSort(Comparator<T>comparator,Class<T>classType,intsiz){this.comparator=comparator;assist_array=(T[])Array.newInstance(classType,siz);}publicMSort(Comparator<T>comparator,T[]assist_array){this.comparator=comparator;this.assist_array=assist_array;}publicvoidmergeOrderedArray(T[]A,T[]B,T[]C,intABegin,intAEnd,intBBegin,intBEnd,intCBegin){inti=ABegin,j=BBegin,k=CBegin;while(i<AEnd&&j<BEnd){if(comparator.compare(A[i],B[j])<0)C[k++]=A[i++];elseC[k++]=B[j++];}while(i<AEnd)C[k++]=A[i++];while(j<BEnd)C[k++]=B[j++];}privatevoid_sort_assist(T[]targets,intbegin,intend){for(inti=begin+1;i<end;++i){Ttarget=targets[i];intj=i-1;for(;j>=begin;--j){if(comparator.compare(targets[j],target)<=0)break;targets[j+1]=targets[j];}targets[j+1]=target;}}privatevoid_sort(T[]targets,intbegin,intend){intlength=end-begin;if(length<=MIN_LENGTH){_sort_assist(targets,begin,end);return;}intmid=begin+(length>>1);_sort(targets,begin,mid);_sort(targets,mid,end);mergeOrderedArray(targets,targets,assist_array,begin,mid,mid,end,begin);System.arraycopy(assist_array,begin,targets,begin,end-begin);}publicvoidsort(T[]targets,intoffset,intlength){intend=offset+length;assertoffset>=0&&offset<targets.length&&end<targets.length:"Out of bound of array";_sort(targets,offset,end);}}classQSort<T>{privatestaticfinalintMIN_LENGTH=4;privateRandomrandom=newRandom();privateComparator<T>comparator;publicQSort(Comparator<T>comparator){this.comparator=comparator;}privatevoid_sort_assist(T[]targets,intbegin,intend){for(inti=begin+1;i<end;++i){Ttarget=targets[i];intj=i-1;for(;j>=begin;--j){if(comparator.compare(targets[j],target)<=0)break;targets[j+1]=targets[j];}tar
|