记录编号 |
214089 |
评测结果 |
AAAAAAAAAA |
题目名称 |
失落的猴子 |
最终得分 |
100 |
用户昵称 |
Marvolo |
是否通过 |
通过 |
代码语言 |
Pascal |
运行时间 |
0.713 s |
提交时间 |
2015-12-14 13:13:24 |
内存使用 |
30.90 MiB |
显示代码纯文本
program zht;
var
n,m,i,j,k,g,w,s:longint;
bh,t:array[0..2000,0..2000] of longint;
x1,x2,y1,y2,p:array[0..10000] of longint;
begin
assign(input,'lostmonkey.in');
assign(output,'lostmonkey.out');
reset(input);
rewrite(output);
readln(n,m,k);
for i:=1 to k do
readln(x1[i],y1[i],x2[i],y2[i],p[i]);
for i:=k downto 1 do
begin
s:=y1[i];
while s<=y2[i] do
begin
if s>y2[i] then break;
w:=x1[i];
while w<=x2[i] do
begin
if w>x2[i] then break;
if t[s,w]=0 then begin bh[s,w]:=p[i]; t[s,w]:=x2[i]; inc(w); continue; end;
w:=t[s,w]+1;
end;
inc(s);
end;
end;
for i:=1 to n do
begin
for j:=1 to m do
write(bh[j,i]);
writeln;
end;
close(input);
close(output);
end.