- 排座椅
- 2010-04-15 19:21:00 @
编译通过...
├ 测试数据 01:运行超时|格式错误...
├ 测试数据 02:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 03:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 04:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 07:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 08:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 09:答案错误...程序输出比正确答案长
├ 测试数据 10:答案错误...程序输出比正确答案长
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:10 有效耗时:0ms
var j,k,l,m,n,htd,ltd,shs,sh1,sh2,sh3,sh4,scs:longint;
bj:array[1..1000,1..1000]of integer;
sc:array[1..2,1..999]of integer;
begin
readln(m,n,htd,ltd,shs);
for j:=1 to shs do begin
readln(sh1,sh2,sh3,sh4);
bj[sh1,sh2]:=j;
bj[sh3,sh4]:=j;
end;
for j:=1 to m do begin
l:=0;
for k:=1 to n do
if (bj[j,k]>0)and(bj[j,k]=bj[j+1,k]) then l:=l+1;
bj[j,n+1]:=l;
end;
for j:=1 to n do begin
l:=0;
for k:=1 to m do
if (bj[k,j]>0)and(bj[k,j]=bj[k,j+1]) then l:=l+1;
bj[m+1,j]:=l;
end;
for j:=1 to m do
if bj[j,n+1]>0 then begin
scs:=+scs+1;
sc[1,scs]:=j;
sc[2,scs]:=bj[j,n+1];
end;
for j:=1 to scs-1 do
for k:=j+1 to scs do
if sc[2,j]scs then htd:=scs;
for j:=1 to htd do begin
for k:=j to htd do
if sc[1,j]>sc[1,k] then begin
l:=sc[1,j];sc[1,j]:=sc[1,k];sc[1,k]:=l;
end;
write(sc[1,j],' ');
end;
writeln;
scs:=0;
for j:=1 to n do
if bj[m+1,j]>0 then begin
scs:=scs+1;
sc[1,scs]:=j;
sc[2,scs]:=bj[m+1,j];
end;
for j:=1 to scs-1 do
for k:=j+1 to scs do
if sc[2,j]scs then ltd:=scs;
for j:=1 to ltd do begin
for k:=j to ltd do
if sc[1,j]>sc[1,k] then begin
l:=sc[1,j];sc[1,j]:=sc[1,k];sc[1,k]:=l;
end;
write(sc[1,j],' ');
end;
writeln;
end.