讨论 / 请教一下这道题该怎么做
sqqssia2 2008-07-19 00:28:00
点我顶贴 收藏 删除
如题
#1 雪域$枫@2007-12-10 21:55:00
回复 删除
"据说"直接模拟就AC,贪心+DP反而不能AC
#2 txyx@2008-03-28 02:08:00
回复 删除
我用枚举+模拟 ac了
#3 rainki@2008-07-19 00:28:00
回复 删除
小學生也會的題目..~(我是小學生嘛)

var w,s,t,w1,t1,s1,a,b,c:longint;

label 146,35;

procedure buxing;

label 10;

begin if (t-t1>=1)and(t1<t) then begin s1:=s1+17;t1:=t1+1;goto 10 end;

if (t-t1>=2)and(t1<t) then begin s1:=s1+34;t1:=t1+2;goto 10 end;

if (t-t1>=3)and(t1<t) then begin s1:=s1+51;t1:=t1+3;goto 10 end;

if (t-t1>=4)and(t1<t) then begin s1:=s1+68;t1:=t1+4;goto 10 end;

10:

end;

begin assign(input,escape.in);

assign(output,escape.out);

reset(input);rewrite(output);

readln(w,s,t);

w1:=w mod 10;t1:=w div 10;s1:=t1*60;

if t1>t then begin s1:=s1-(t1-t)*60;t1:=t;end;

146:

while (t>t1)and(s1<s) do

case w1 of

0,1:if (t-t1>=4)and(s-s1>68) then begin w1:=w1+12-10;t1:=t1+4;s1:=s1+60;goto 146;end

else goto 35;

2,3,4,5:if (t-t1>=3) then begin w1:=w1+8-10;t1:=t1+3;s1:=s1+60;goto 146;end;

6,7,8,9:if t-t1>=2 then begin w1:=w1+4-10;t1:=t1+2;s1:=s1+60;goto 146;end;

else begin 35:buxing;end;

end;

if (s1<s)or(t1>t) then begin writeln(No);write(s1);end;

if (s1>=s)and(t1<=t)then begin writeln(Yes);write(t1);end;

close(input);close(output);

end.

(*^__^*) 嘻嘻…….

查看更多回复
提交回复