比赛 20120705 评测结果 C
题目名称 绘画 最终得分 0
用户昵称 isabella 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2012-07-05 11:52:52
显示代码纯文本
var
 s:array[1..1000,0..100,0..100]of longint;
 map:array[0..100,0..100]of longint;
 i,j,k,m,n,p,tot,code,x1,x2,y1,y2,mid,l:longint;
 ss,c:string;

begin
assign(input,'drawing.in');reset(input);
assign(output,'drawing.out');rewrite(output);
 tot:=0;
 readln(n,k,m);
 for i:=0 to n-1 do
  for j:=0 to n-1 do map[i,j]:=1;

 for l:=1 to m do
  begin

   readln(ss);
   p:=pos(' ',ss);
   c:=copy(ss,1,p-1);
   if ss='SAVE'then
     begin
      inc(tot);s[tot]:=map;
     end
   else if c='LOAD'then begin
      delete(ss,1,p);val(ss,k,code);map:=s[k];
     end
   else begin
     delete(ss,1,p);p:=pos(' ',ss);c:=copy(ss,1,p-1);
     val(c,k,code);
     delete(ss,1,p);p:=pos(' ',ss);c:=copy(ss,1,p-1);
     val(c,x1,code);
     delete(ss,1,p);p:=pos(' ',ss);c:=copy(ss,1,p-1);
     val(c,y1,code);
     delete(ss,1,p);p:=pos(' ',ss);c:=copy(ss,1,p-1);
     val(c,x2,code);
     delete(ss,1,p);
     val(ss,y2,code);

     i:=x1;
     while i<=x2 do
      begin
        j:=y1;
        while j<=y2 do begin map[i,j]:=k;j:=j+2;end;
        i:=i+2;
      end;

     i:=x1+1;
     while i<=x2 do
      begin
        j:=y1+1;
        while j<=y2 do begin map[i,j]:=k;j:=j+2;end;
        i:=i+2;
      end;
   end;
  end;

 for i:=0 to n-1 do
  begin
   for j:=0 to n-2 do write(map[i,j],' ');writeln(map[i,n-1]);
  end;

 close(input);close(output);
end.