比赛 20091102 评测结果 WWWWWWWWWW
题目名称 溶液模拟器 最终得分 0
用户昵称 rottenwood 运行时间 0.000 s
代码语言 Pascal 内存使用 0.00 MiB
提交时间 2009-11-02 10:13:31
显示代码纯文本
program simulator;
var
i,j,k,m,n,f,code:longint;
flag:boolean;
s1,s2:string;
s:array[1..10001,1..2] of real;
rz,nrz,v0,c0,v,c,ans:real;
begin
assign(input,'simulator.in');reset(input);
assign(output,'simulator.out');rewrite(output);
readln(v0,c0);
readln(n);
f:=1;
s[f,1]:=v0;s[f,2]:=c0;
for i:=1 to n do
BEGIN
 readln(s1);
 s2:=copy(s1,1,1);
 if s2='p' then
 begin
 flag:=true;
 delete(s1,1,2);
 s2:=copy(s1,1,pos(' ',s1)-1);
 val(s2,v,code);
 delete(s1,1,pos(' ',s1));
 s2:=s1;
 val(s2,c,code);
 end;
 if s2='z' then flag:=false;
if flag then
begin
inc(f);
 rz:=v0*c0*0.01;
 nrz:=v*c*0.01;
 rz:=rz+nrz;
 v0:=v0+v;
 ans:=rz/v0*100;
 s[f,1]:=v0;s[f,2]:=ans;
 writeln(v0:0:0,' ',ans:0:5);
end
else
if f>1 then
begin
v0:=s[f-1,1];c0:=s[f-1,2];
writeln(v0:0:0,' ',c0:0:5);
end;
end;
close(output);
end.