226拿了90分。。。第3个点爆了。。
题目:[JSOI2007]汇编语言
状态: Unaccepted
测评机: Xeost[5]
得分: 90分
提交日期: 2013-7-20 21:58:00
有效耗时: 1468毫秒
测试结果1: 通过本测试点|有效耗时187ms
测试结果2: 通过本测试点|有效耗时156ms
测试结果3: 运行错误|未定义错误编号|错误编号:106
测试结果4: 通过本测试点|有效耗时156ms
测试结果5: 通过本测试点|有效耗时172ms
测试结果6: 通过本测试点|有效耗时172ms
测试结果7: 通过本测试点|有效耗时156ms
测试结果8: 通过本测试点|有效耗时156ms
测试结果9: 通过本测试点|有效耗时156ms
测试结果10:通过本测试点|有效耗时157ms
program pid226;
var
ans,i,j,n:longint;
a:array[0..201,0..6] of char;
b:array[0..201] of boolean;
num:array[0..201] of byte;
begin
ans:=0;
readln(n);
fillchar(num,sizeof(num),0);
for i:=1 to n do begin
for j:=1 to 3 do
if not eoln then
read(a[i,j])
else
break;
if (a[i,1]='j') and (a[i,2]='m') and (a[i,3]='p')
then read(num[i]);
readln
end;
fillchar(b,sizeof(b),true);
i:=0;
while i<n do begin
inc(i);
inc(ans);
if not b[i] then
begin ans:=0; break end;
b[i]:=false;
if num[i]<>0 then i:=num[i]-1;
end;
write(ans);
end.