比赛 |
07级noip练习1 |
评测结果 |
AAAAAAAAAA |
题目名称 |
守望者的逃离 |
最终得分 |
100 |
用户昵称 |
苏轼 |
运行时间 |
0.000 s |
代码语言 |
Pascal |
内存使用 |
0.00 MiB |
提交时间 |
2008-09-22 22:08:43 |
显示代码纯文本
program cch(input,output);
const
maxm=30;
mins=-100000000;
var
f,g:array[-20..30] of longint;
i,m,s,t,j,time,s1,maxs:longint;
ans:longint;
function max(x,y:longint):longint;
begin
if x>y then exit(x)
else exit(y);
end;
begin
assign(input,'escape.in');
assign(output,'escape.out');
reset(input);
rewrite(output);
readln(m,s,t);
for i:=-20 to maxm do f[i]:=mins;
time:=0; s1:=s;
while m>=10 do
begin
inc(time);dec(s1,60);
dec(m,10);
if s1<=0 then begin writeln('Yes'); write(time); close(input); close(output); halt; end;
if time=t then begin writeln('No'); write(s-s1); close(input); close(output); halt; end;
end;
dec(t,time);
f[m]:=s-s1;
ans:=0;
for i:=1 to t do
begin
g:=f;
for j:=0 to 20 do
begin
if f[j+10]>=0 then g[j]:=max(g[j],f[j+10]+60);
if f[j]>=0 then g[j]:=max(g[j],f[j]+17);
g[j]:=max(g[j],f[j-4]);
if g[j]>=s then
begin
writeln('Yes');
write(i+time);
close(input); close(output);
halt;
end;
if g[j]>ans then ans:=g[j];
end;
f:=g;
end;
writeln('No');
write(ans);
close(input);
close(output);
end.