3 5 5 A1 input 100 B2 input 200 C3 sum A1 C2 C5 avg B2 C4 C5 output
83
介个是一道灰常繁琐的强模拟——话不多说,既然是福利,就直接上程序(不要问我程序是谁):
var
a:array ['A'..'Z',1..100,1..4] of longint;
b:array ['A'..'Z',1..100,1..2] of char;
ch,k,x,n:char;
i,m,s,y,t:longint;
function js(x:char;y:longint):longint;
var
i:char;
j:longint;
s:real;
begin
case a[x,y,1] of
0:exit(0);
1:exit(a[x,y,2]);
else begin
s:=0;
for i:=b[x,y,1] to b[x,y,2] do
for j:=a[x,y,2] to a[x,y,3] do
s:=s+js(i,j);
if a[x,y,1]=3 then exit(trunc(s/a[x,y,4])) else exit(trunc(s));
end;
end;
end;
begin
assign(input,'excel.in'); reset(input);
assign(output,'excel.out'); rewrite(output);
read(m); n:=chr(m+64); readln(m); readln(s);
for t:=1 to s do
begin
read(x,y); read(k); read(ch);
case ch of
'i':begin
for i:=1 to 5 do
read(k);
readln(a[x,y,2]);
a[x,y,1]:=1;
end;
'o':begin
readln;
writeln(js(x,y));
end;
else begin
for i:=1 to 3 do
read(k);
readln(b[x,y,1],a[x,y,2],k,b[x,y,2],a[x,y,3]);
if ch='s' then a[x,y,1]:=2 else begin
a[x,y,1]:=3;
a[x,y,4]:=(ord(b[x,y,2])-ord(b[x,y,1])+1)*(a[x,y,3]-a[x,y,2]+1);
end;
end;
end;
end;
close(input); close(output);
end.
顺便讲一下,介个强模拟有技巧,就是对于非常数的格子,要在递归里面求。(介样省时省力)