比赛 20091102 评测结果 WWWWWWWWWW
题目名称 溶液模拟器 最终得分 0
用户昵称 ReimBurSe. 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2009-11-02 10:55:54
显示代码纯文本
Program simulator;

Type
abc=record
 m:int64;
 c:real;
end;
sc=array [0..10000] of abc;

Var
i,j:longint;
n:longint;
s:sc;
p,tm:longint;
k:char;
tc,m:real;

Begin
assign(input,'simulator.in');
assign(output,'simulator.out');
reset(input);
rewrite(output);
readln(s[0].m,s[0].c);
readln(n);
p:=0;
s[0].c:=s[0].c/100;
for i:=1 to n do begin
 read(k);
 if k='P' then begin
  p:=p+1;
  read(k);
  readln(tm,tc);
  m:=s[i-1].m*s[i-1].c;
  m:=m+tm*(tc/100);
  s[i].m:=s[i-1].m+tm;
  s[i].c:=m/s[i].m;
 end;
 if k='Z' then begin
  p:=p-2;
  if p<=0 then begin
   s[i].m:=s[0].m;
   s[i].c:=s[0].c;
  end
  else begin
   s[i].m:=s[p].m;
   s[i].c:=s[p].c;
  end;
  readln;
 end;
 writeln(s[i].m,' ',(s[i].c*100):0:5);
end;
close(input);
close(output);
End.