ENG  RUS Timus Online Judge
Online Judge
Problems
Authors
Online contests
Site news
Webboard
Problem set
Submit solution
Judge status
Guide
Register
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

## Discussion of Problem 1642. 1D Maze

WA 18
Posted by coolhackermasya 13 Mar 2017 23:06
var
b,a,i,c,n,d,an,k,x:integer;  // many variables from other programms...
dev:boolean;
s:string;
begin
dev:=true;
b:=1001;
if n<0 then x:=-1;
if n>0 then x:=1;
for i:=1 to k do
begin
if (0<a*x) and (a*x<n*x) and dev then begin s:=('Impossible'); dev:=false end; // can't reach the end
if abs(a)<b then b:=abs(a);      //nearest obsacle to start point
end;
if dev then // output
begin
if n>0 then writeln(n,' ',n+b*2);
if n<0 then writeln(abs(n)+2*b,' ',abs(n));
end
else
writeln(s);
end.

**********Can't understand what's wrong************
Re: WA 18
Posted by Daniel Paleyev [SESC] 17 Oct 2017 19:14
input :
15 23
252 33 215 789 1000 123 -125 29 -45 -450 121 -555 -72 120 123
output :
23 113