讨论 / DP,so easy
骨头架 2015-10-23 05:31:45
点我顶贴 收藏 删除
代码附上

var

i,j,k,n,m,t:longint;

f:array[0..3000000] of longint;

function max(a,b:longint):longint;

begin if a>b then max:=a else max:=b; end;

begin

assign(input,'escape.in');

assign(output,'escape.out');

reset(input);

rewrite(output);

read(n,m,t);

for i:=1 to t do

if n>=10 then

begin

n:=n-10;

f[i]:=f[i-1]+60;

end

else

begin

n:=n+4;

f[i]:=f[i-1];

end;

for i:=1 to t do

begin

f[i]:=max(f[i],f[i-1]+17);

if f[i]>m then

begin

writeln('Yes');

write(i);

close(input);

close(output);

exit;

end;

end;

writeln('No');

write(f[t]);

close(input);

close(output);

end.

查看更多回复
提交回复