- 守望者的逃离
- 2013-10-04 19:41:43 @
编译成功
测试数据 #0: Accepted, time = 0 ms, mem = 17420 KiB, score = 10
测试数据 #1: WrongAnswer, time = 0 ms, mem = 17420 KiB, score = 0
测试数据 #2: WrongAnswer, time = 0 ms, mem = 17420 KiB, score = 0
测试数据 #3: Accepted, time = 15 ms, mem = 17420 KiB, score = 10
测试数据 #4: Accepted, time = 15 ms, mem = 17420 KiB, score = 10
测试数据 #5: Accepted, time = 31 ms, mem = 17416 KiB, score = 10
测试数据 #6: Accepted, time = 15 ms, mem = 17424 KiB, score = 10
测试数据 #7: Accepted, time = 0 ms, mem = 17420 KiB, score = 10
测试数据 #8: Accepted, time = 46 ms, mem = 17424 KiB, score = 10
测试数据 #9: WrongAnswer, time = 0 ms, mem = 17420 KiB, score = 0
WrongAnswer, time = 122 ms, mem = 17424 KiB, score = 70
program P1431;
uses math;
var m,s,t,d,tt,ansd,anst,i,j:longint;
f:array[0..300001,0..13]of longint;
begin
readln(m,s,t);
tt:=m div 10;
d:=tt*60;
m:=m mod 10;
f[tt][m]:=d;
for i:=tt to t do
for j:=0to 13do
begin
f[i+1][j]:=max(f[i+1][j],f[i][j]+17);
if j<10then f[i+1][j+4]:=max(f[i+1][j+4],f[i][j])
else f[i+1][j-10]:=max(f[i+1][j-10],f[i][j]+60);
end;
ansd:=0; anst:=0;
for i:=tt to t do
begin
for j:=0to 13do
begin
if f[i][j]>=s then
begin
anst:=i; break;
end;
ansd:=max(ansd,f[i][j]);
end;
if anst>0then break;
end;
if anst>0then
begin
writeln('Yes'); writeln(anst);
end
else
begin
writeln('No'); writeln(ansd);
end;
end.
3 条评论
-
21002 LV 8 @ 2013-10-13 09:20:24
AC标
-
2013-10-13 09:20:04@
呵呵
var
m,s,t,ti:longint;
ms:array[1..2,0..300000] of longint;
ts:array[0..300000] of longint;
begin
readln(m,s,t);
ms[2,0]:=m;
ts[0]:=0;
for ti:=1 to t do
begin
if ms[2,ti-1] >= 10 then
begin
ms[1,ti]:=ms[1,ti-1]+60;
ms[2,ti]:=ms[2,ti-1]-10;
end
else
begin
ms[1,ti]:=ms[1,ti-1];
ms[2,ti]:=ms[2,ti-1]+4;
end;
if ts[ti-1]+17 > ms[1,ti] then
ts[ti]:=ts[ti-1]+17
else
ts[ti]:=ms[1,ti];
if ts[ti] >= s then
begin
writeln('Yes');
writeln(ti);
halt;
end;
//main
end;
writeln('No');
writeln(ts[t]);
end. -
2013-10-07 08:28:32@
敢问你for j:=0 to 13 do 的13是哪里来的。。。
- 1