← Back to topics
Topic

z-rectangle is too generous

r
ronioso
I coded a solution for z-rectangle which is really wrong but passed, and i bet 100 bucks that it is the official solution (well...). It fails with input 11 13. My algorithm gives 8.
Right answer is: 6
Here is the example with 6 squares in a lovely ASCII art.
AAAACCCCFFFFF
AAAACCCCFFFFF
AAAACCCCFFFFF
AAAACCCCFFFFF
BBBBBBBDFFFFF
BBBBBBBEEEEEE
BBBBBBBEEEEEE
BBBBBBBEEEEEE
BBBBBBBEEEEEE
BBBBBBBEEEEEE
BBBBBBBEEEEEE
Maybe we can change a little bit the task statement so that the old solution solves the new problem (like 'when you cut you go from one edge to the opposite one; you can't stop in the middle' or something like this, the less obvious the better XD).
Thanks a lot. Bye bye!
d
dejandenib
Hm, i solved this task and my algorithm also gives answer 8 instead of 6. Thank you for noticing this bug. We can't change the task statement. But for the test cases, i don't know what to do. Any suggestions?