为什么错???求大神指教!!!

var
m,s,t,x,y:longint;
begin
readln(m,s,t);
y:=t;
x:=s;
while t>0 do begin
if m>=10 then begin
m:=m-10;
s:=s-60;
t:=t-1;
end;
if m<10 then begin
if (m=9) or (m=8) or (m=7) or (m=6) then begin
if (t-2>=0) then begin
s:=s-60;
t:=t-2;
m:=0;
end;
if (t-2<0) then begin
s:=s-17*(2-t);
t:=0;
end;
end;
if (m=5) or (m=4) or (m=3) or (m=2) then begin
if (t-3>=0) then begin
s:=s-60;
t:=t-3;
m:=0;
end;
if (t-3<0) then begin
s:=s-17*(3-t);
t:=0;
end;
end;
if (m=0) or (m=1) then begin
if (t-1>=0) then begin
s:=s-17;
t:=t-1;
end;
end;
end;
end;
if s>0 then begin
writeln('No');
writeln(x-s);
end;
if s<=0 then begin
writeln('Yes');
s:=abs(s);
s:=s div 17;
writeln(abs(y-s));
end;
end.

0 条评论

目前还没有评论...

信息

ID
1431
难度
5
分类
动态规划 | 背包 点击显示
标签
递交数
6158
已通过
1917
通过率
31%
被复制
22
上传者