讨论 / zaadszd
zhyj 2010-07-28 15:33:00
点我顶贴 收藏 删除
type q=record

x,y:integer;

end;

Var i,j,t,n,m:integer;

a:array[1..10000] of q;

s:q;

begin

read(n,m);

for i:=1 to n do read(a[i].x,a[i].y);

for i:=1 to n-1 do

for j:=i+1 to n do

begin

if a[i].y<a[j].y then

begin

s:=a[i];a[i]:=a[j];a[j]:=s;

end;

if a[i].y=a[j].y then

if a[i].x>a[j].x then

begin

s:=a[i];a[i]:=a[j];a[j]:=s;

end; end;

m:=trunc(m*1.5);

for i:=m+1 to n do

if a[m].y=a[i].y then

inc(m);

writeln(a[m].y,' ',m);

for i:=1 to m do

writeln(a[i].x,' ',a[i].y);

end.

查看更多回复
提交回复