SGU 114 — Telecasting station
水题.求出中位数即可.
根据WindyWinter的blog,有两点注意.
Pascal注意,读入n对数时,应该用read而不是readln,因为虽然样例数据有换行,但题目中的描述是没有换行的.否则会像我一样WA on 14.
C++注意,iostream会TLE on 12.
{ SGU 114; Telecasting station - sqybi’s code}//for my winstyprogram sgu114_sqybi; const nn = 15000;
type rec = record p, v: longint; end;
var s, t, n, i: longint; a: array[1..nn]of rec;
procedure qsort(l, r: longint); var i, j, d: longint; t: rec; begin if l >= r […]