比赛 20091102 评测结果 EEEEEEEEEE
题目名称 溶液模拟器 最终得分 0
用户昵称 chengyang 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2009-11-02 10:19:53
显示代码纯文本
program simulator;
var
  a:array[0..10001]of longint;
  b:array[0..10001]of real;
  i,j,v,c,n,cc,vv,w:longint;
  s:char;
  ans:real;
begin
  assign(input,'simulator.in');
  assign(output,'simulator.out');
  reset(input);
  rewrite(output);
  readln(cc,vv);
  a[0]:=cc; b[0]:=(cc*vv)/100;
  readln(n);
  for i:=1 to n do begin
  read(s);
  if s='p' then begin
      readln(c,v);
      a[i]:=a[i-1]+c;
      b[i]:=b[i-1]+(c*v)/100;
    end
    else begin
      a[i]:=a[i-2];
      b[i]:=b[i-2];
    end;
  end;
  for i:=1 to n do
  writeln (a[i],' ',b[i]/a[i]*100:0:5);
  close(input); close(output);
end.