记录编号 4438 评测结果 WWWAWWAAAA
题目名称 [NOIP 2007]守望者的逃离 最终得分 50
用户昵称 Gravatarname:弓虽 是否通过 未通过
代码语言 Pascal 运行时间 0.055 s
提交时间 2008-10-19 17:31:31 内存使用 0.11 MiB
显示代码纯文本
program escape(input,output); 
var 

m,ss,t,ma,ta,tt,i:longint; 
s:longint; 

begin 

assign(input,'escape.in'); 
assign(output,'escape.out'); 

reset(input);rewrite(output); 
readln(m,s,t); 
ss:=0;tt:=0; 
ta:=m div 10;ma:=m mod 10; 
if ta>=t then 
while (s>ss) and (tt<t) do 
begin 
ss:=ss+60;inc(tt); 
end else 
begin ss:=ss+60*ta;tt:=tt+ta;end; 
while (s-ss>0) and ((t-tt)>0) do 
begin 
if (s-ss<=17) then begin ss:=ss+17;inc(tt);continue;end; 
if ((s-ss>17)and(s-ss<=34)and (ma<6)) then begin ss:=ss+17;inc(tt);continue;end; 
if ((s-ss>34)and (s-ss<=51)and (ma<2)) then begin ss:=ss+17;inc(tt);continue;end; 
if ((s-ss>51)and (s-ss<=68)) then begin ss:=ss+17;inc(tt);continue;end; 
if ((t-tt<7) and (ma<2)) or ((t-tt<3) and ((ma>1) and (ma<=5)))then 

repeat ss:=ss+17;inc(tt) until (s-ss<=0) or ((t-tt)<=0) else 
begin 
repeat ta:=(ma+4)div 10;inc(tt);ma:=(ma+4)mod 10;until ta=1; 
ss:=ss+60;inc(tt); 
end; 
end; 
if s-ss<=0 then 
begin writeln('Yes');writeln(tt); end 
else begin writeln('No');writeln(ss); end; 
close(input);close(output); 
end.