vj1115 火星人

vj1115 火星人 -

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//±ÉÈ˵ķ½·¨ //ÿ´ÎÕÒµ±Ç°ÐòÁеĺóÒ»¸ö ¹²ÕÒ m ´Î //·½·¨ÊÇ´ÓºóÏòÇ°ÕÒ Èç¹ûºóÃæÓбȵ±Ç°Êý(x)´óµÄÊý(y) //°Ñ x ºÍ y »¥»» È»ºóÔÀ´ x λÖúóÃæµÄÊý´ÓСµ½´óÅÅÐò ÔòÕâÊǵ±Ç°ÐòÁеĺóÒ»¸öÐòÁÐ À const maxn=10000; var n,m:integer; a:array[0. .maxn] of integer; procedure init; var i:integer; begin readln(n); readln(m); for i:=1 to n do read(a[i]); end; procedure qs(l,r:integer); var i,j,t,mid:integer; begin i:=l; j:=r; mid:=a[(i+j) >> 1]; repeat while a[i]<mid do inc(i); while a[j]>mid do dec(j); if i<=j then begin t:=a[i]; a[i]:=a[j]; a[j]:=t; inc(i); dec(j);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/21/2011 for the course CS 001 taught by Professor 001 during the Spring '11 term at Shandong University.

Page1 / 2

vj1115 火星人 -

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online