讨论 / 其实挺简单的……理解问题
某魔塔一路暴狂 2013-07-12 22:07:00
点我顶贴 收藏 删除
状态: Accepted

测评机: Xeost[5]

得分: 100分 [我要评价一下题目~]

提交日期: 2013-7-13 13:05:00

有效耗时: 1954毫秒

测试结果1: 通过本测试点|有效耗时172ms

测试结果2: 通过本测试点|有效耗时156ms

测试结果3: 通过本测试点|有效耗时219ms

测试结果4: 通过本测试点|有效耗时250ms

测试结果5: 通过本测试点|有效耗时188ms

测试结果6: 通过本测试点|有效耗时172ms

测试结果7: 通过本测试点|有效耗时172ms

测试结果8: 通过本测试点|有效耗时203ms

测试结果9: 通过本测试点|有效耗时203ms

测试结果10: 通过本测试点|有效耗时219ms

#1 某魔塔一路暴狂@2013-07-12 22:07:00
回复 删除
var

ch:char;

f11,f21,winer,i:longint;

v11,v21:array[1..10000,-1..1] of longint;

begin

read(ch); f11:=1; f21:=1;

v11[1,1]:=0; v11[1,-1]:=0; v21[1,1]:=0; v21[1,-1]:=0;

while ch<>'E' do begin

case ch of

'W':winer:=1;

'L':winer:=-1;

else

winer:=0;

end;

if winer<>0 then begin

v11[f11,winer]:=v11[f11,winer]+1;

v21[f21,winer]:=v21[f21,winer]+1;

if(v11[f11,winer]>=11)and

(v11[f11,winer]-v11[f11,-winer]>=2)then begin

f11:=f11+1;

v11[f11,1]:=0;

v11[f11,-1]:=0;

end;

if(v21[f21,winer]>=21)and

(v21[f21,winer]-v21[f21,-winer]>=2)then begin

f21:=f21+1;

v21[f21,1]:=0;

v21[f21,-1]:=0;

end end;

read(ch);

end;

for i:=1 to f11 do begin

writeln(v11[i,1],':',v11[i,-1]);

end; writeln;

for i:=1 to f21 do begin

writeln(v21[i,1],':',v21[i,-1]);

end;

end.

查看更多回复
提交回复