| 比赛 | 
    20120705 | 
    评测结果 | 
    EEEEEEEEEE | 
    | 题目名称 | 
    绘画 | 
    最终得分 | 
    0 | 
    | 用户昵称 | 
    wo shi 刘畅 | 
    运行时间 | 
    0.000 s  | 
    | 代码语言 | 
    Pascal | 
    内存使用 | 
    0.00 MiB  | 
    | 提交时间 | 
    2012-07-05 11:08:50 | 
显示代码纯文本
type
  jp=array[0..101,0..101]of longint;
var
  ch:char;
  s:string;
  time,t,x1,y1,x,x2,y2,i,j,n,k,m,c:longint;
  g:array[0..10000]of longint;
  q:array[0..1000]of jp;
begin
  assign(input,'drawing.in'); reset(input);
  assign(output,'drawing.out'); rewrite(output);
  readln(n,k,m);
  for i:=1 to n do
   for j:=1 to n do
   q[0][i,j]:=1;
  for time:=1 to m do
  begin
    read(ch);
    q[time]:=q[time-1];
    s:='';
    repeat
      s:=s+ch;
      read(ch);
    until not (ch in ['A'..'Z']);
    if s='PAINT' then begin
        readln(c,x1,y1,x2,y2);
        inc(x1);
        inc(y1);
        inc(x2);
        inc(y2);
        for i:=x1 to x2 do
        begin
          if not odd(i-x1) then
          for j:=y1 to y2 do
          begin
            if not odd(j-y1) then
            q[time,i,j]:=c;
          end
          else for j:=y1 to y2 do
          begin
            if odd(j-y1) then
            q[time,i,j]:=c;
          end;
        end;
      end;
   if s='SAVE' then begin
   readln;
        inc(t);
        g[t]:=time;
      end;
    if s='LOAD'then begin
        readln(x);
        q[time]:=q[g[x]];
      end;
  end;
  for i:=1 to n do
  begin
   for j:=1 to n do
   write(q[time][i,j],' ');
   writeln;
  end;
  close(input);
  close(output);
end.