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 1145. Rope in the Labyrinth

Weak tests
Posted by Fyodor Menshikov 9 Jan 2009 17:18
Test generated by the following program is hard for recursive solutions on some languages. For example Java recursive solution uses approx 31M of stack on this test while the whole ML of this problem is 16M.

Very very strange that the test set does not contain test with maximal possible answer.

const
height = 1000;
width = 1000;
var
line, column : integer;
begin
writeln(height, ' ', width);
for line := 1 to height do begin
for column := 1 to width do begin
if
(line = 1) or (line = height) or
(column = 1) or (column = width) or
(line mod 4 = 1) and (column > 2) or
(line mod 4 = 3) and (column < width - 1)
then begin
write('#');
end
else begin
write('.');
end;
end;
writeln;
end;
end.

Edited by author 09.01.2009 17:29
Re: Weak tests
Posted by Fyodor Menshikov 17 Jan 2009 02:58
up