who can tell me why I got 'Wrong Answer'?
Posted by
qwt 2 Feb 2002 18:51
var
d,e,f,ep,dp,h:longint;
t,i,j,k:longint;
way:Array[0..30] of 0..1;
begin
readln(d,e,f,dp,ep,h);
fillchar(way,sizeof(way),0);
t:=0;
for i:=f-1 downto d do begin
if dp<=t+1 shl i then way[i+1]:=0 else way[i+1]:=1;
inc(t,way[i+1]*(1 shl i));
end;
t:=0;
for i:=f-1 downto e do begin
if ep<=t+1 shl i then j:=0 else j:=1;
if j<>way[i+1] then break;
inc(t,j*(1 shl i));
end;
k:=(f-e)+(f-d)-2*(f-i-1);
if k<=h then writeln('YES') else writeln('NO');
end.