记录编号 | 14856 | 评测结果 | AAAAAAAAAT | ||
---|---|---|---|---|---|
题目名称 | 美酒节赛羊 | 最终得分 | 90 | ||
用户昵称 | 是否通过 | 未通过 | |||
代码语言 | Pascal | 运行时间 | 1.866 s | ||
提交时间 | 2009-11-05 17:48:04 | 内存使用 | 0.11 MiB | ||
program goat; type shuzu=array[-8..100] of longint; shuzu1=array[1..3] of longint; var f,b:shuzu; flag:boolean; m:shuzu1; t,p,i,j,k,n,temp,s,min:longint; begin assign(input,'goat.in');reset(input); assign(output,'goat.out');rewrite(output); readln(s,p); flag:=true; t:=0; while flag do begin inc(t); for j:=0 to p do begin f[j]:=b[j+1]+1; if b[0]+1>f[j] then f[j]:=b[0]+1; if (b[j-2]+5>f[j])and(j-2>0) then f[j]:=b[j-2]+5; if (b[j-5]+10>f[j])and(j-5>0) then f[j]:=b[j-5]+10; if f[j]>=s then begin flag:=false; writeln(t); close(output); halt;end; end; for k:=0 to p do b[k]:=f[k]; end; close(output); end.