标题: 信息学奥赛普及组第3题---守望者的逃离, 这题让人震惊了
性别:男-离线 阿巽


Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15Rank: 15
组别 羽林都尉
级别 骠骑将军
功绩 107
帖子 9706
编号 47733
注册 2005-9-3
来自 善化
家族 慕容世家


发表于 2007-12-5 21:20 资料 个人空间 短消息 看全部作者
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.

本帖最近评分记录
青木风亮 2007-12-5 22:30 +50 go on!


顶部

正在浏览此帖的会员 - 共 2 人在线




当前时区 GMT+8, 现在时间是 2025-2-9 01:24
京ICP备2023018092号 轩辕春秋 2003-2023 www.xycq.org.cn

Powered by Discuz! 5.0.0 2001-2006 Comsenz Inc.
Processed in 0.008854 second(s), 10 queries , Gzip enabled

清除 Cookies - 联系我们 - 轩辕春秋 - Archiver - WAP