/ SB域 /

记录详情

Accepted

/usr/bin/ld.bfd: warning: /out/link.res contains output sections; did you forget -T?
# 状态 耗时 内存占用
#1 Accepted 1ms 256.0 KiB
#2 Accepted 1ms 256.0 KiB
#3 Accepted 1ms 256.0 KiB
#4 Accepted 1ms 256.0 KiB
#5 Accepted 1ms 256.0 KiB
#6 Accepted 1ms 256.0 KiB
#7 Accepted 1ms 256.0 KiB
#8 Accepted 1ms 256.0 KiB
#9 Accepted 0ms 256.0 KiB
#10 Accepted 1ms 256.0 KiB
#11 Accepted 1ms 256.0 KiB
#12 Accepted 1ms 256.0 KiB
#13 Accepted 1ms 256.0 KiB
#14 Accepted 1ms 256.0 KiB
#15 Accepted 1ms 256.0 KiB
#16 Accepted 1ms 256.0 KiB
#17 Accepted 1ms 256.0 KiB
#18 Accepted 1ms 256.0 KiB
#19 Accepted 1ms 256.0 KiB
#20 Accepted 1ms 256.0 KiB
#21 Accepted 1ms 256.0 KiB
#22 Accepted 1ms 256.0 KiB
#23 Accepted 1ms 256.0 KiB
#24 Accepted 1ms 256.0 KiB
#25 Accepted 1ms 256.0 KiB
#26 Accepted 1ms 256.0 KiB
#27 Accepted 1ms 256.0 KiB
#28 Accepted 1ms 256.0 KiB
#29 Accepted 1ms 256.0 KiB
#30 Accepted 1ms 256.0 KiB
#31 Accepted 1ms 256.0 KiB
#32 Accepted 1ms 256.0 KiB
#33 Accepted 0ms 256.0 KiB
#34 Accepted 1ms 256.0 KiB
#35 Accepted 0ms 256.0 KiB
#36 Accepted 0ms 256.0 KiB
#37 Accepted 0ms 256.0 KiB
#38 Accepted 0ms 256.0 KiB
#39 Accepted 0ms 256.0 KiB
#40 Accepted 1ms 256.0 KiB
#41 Accepted 0ms 256.0 KiB
#42 Accepted 0ms 256.0 KiB
#43 Accepted 0ms 256.0 KiB
#44 Accepted 0ms 256.0 KiB
#45 Accepted 1ms 256.0 KiB
#46 Accepted 0ms 256.0 KiB
#47 Accepted 0ms 256.0 KiB
#48 Accepted 0ms 256.0 KiB
#49 Accepted 0ms 256.0 KiB
#50 Accepted 0ms 256.0 KiB
#51 Accepted 0ms 256.0 KiB
#52 Accepted 0ms 256.0 KiB
#53 Accepted 0ms 256.0 KiB
#54 Accepted 0ms 256.0 KiB
#55 Accepted 0ms 256.0 KiB
#56 Accepted 0ms 256.0 KiB
#57 Accepted 0ms 256.0 KiB
#58 Accepted 0ms 256.0 KiB

代码

var x1,y1,x2,y2,area,ans:array[1..50]of longint;
    n,k,now,i,j:longint;
procedure swap(var a,b:longint);
var t:longint;
begin
t:=a; a:=b; b:=t;
end;
procedure cal(l,r,b,t,z:longint);
begin
  while (z<=n) and ((r<=x1[z]) or (l>=x2[z]) or (t<=y1[z]) or (b>=y2[z])) do inc(z);
  if z>n then begin inc(area[now],(r-l)*(t-b));exit;end;
  if l<x1[z] then begin cal(l,x1[z],b,t,z+1);l:=x1[z];end;
  if r>x2[z] then begin cal(x2[z],r,b,t,z+1);r:=x2[z];end;
  if b<y1[z] then cal(l,r,b,y1[z],z+1);
  if t>y2[z] then cal(l,r,y2[z],t,z+1);
end;
begin
 readln(n,k);
 for i:=1 to n do read(x1[i]); readln;
 for i:=1 to n do read(y1[i]); readln;
 for i:=1 to n do read(x2[i]); readln;
 for i:=1 to n do read(y2[i]); readln;
 for i:=n downto 1 do begin
  ans[i]:=i;
  now:=i;
  cal(x1[now],x2[now],y1[now],y2[now],i+1);
 end;
 for i:=1 to n-1 do
  for j:=i+1 to n do
  if (area[i]<area[j])or((area[i]=area[j])and(ans[i]>ans[j]))
  then begin swap(area[i],area[j]); swap(ans[i],ans[j]); end;
 for i:=1 to k-1 do
  for j:=i+1 to k do
   if ans[i]>ans[j] then swap(ans[i],ans[j]);
  for i:=1 to k-1 do write(ans[i]-1,' ');
  writeln(ans[k]-1);
  close(input);
  close(output);
end.

信息

递交者
类型
递交
题目
着色的矩形 ColoringRectangles
题目数据
下载
语言
Pascal
递交时间
2017-08-22 16:30:48
评测时间
2017-08-22 16:30:48
评测机
分数
100
总耗时
68ms
峰值内存
256.0 KiB