vj1097 &aring;ˆ&aring;&sup1;&para;&aelig;žœ&aring;&shy;

# Vj1097 &aring;ˆ&aring;&sup1;&para;&aelig;žœ&aring;&shy;

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

//±ÉÈËµÄ·½·¨ //ÏÈ°ÑÔÀ´¹û×ÓÅÅÐò ÔÙ¿ªÒ»¸öÐÂ¶ÓÁÐ´æÃ¿´ÎºÏ³ÉµÄ ÕâÑùÁ½¸ö¶ÓÁÐ¶¼ÊÇµ¥ÔöµÄ À const maxn=10000; var n,m,ans:longint; a,b:array[0. .maxn] of longint; procedure qs(l,r:integer); var i,j,mid,t: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); end; until i>j; if j>l then qs(l,j); if i<r then qs(i,r); end; procedure init; var i:integer; begin

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

View Full Document
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

Vj1097 &aring;ˆ&aring;&sup1;&para;&aelig;žœ&aring;&shy;

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

View Full Document
Ask a homework question - tutors are online