Hi,
I was getting a TLE on spoj.pl/problems/VONNY/1 with an inefficient recursive solution. So, I fixed up the solution quite a bit, and still have a recursive set up. It now runs crazy fast.
I have randomly generated 1000 grids both totally randomly with cells from 0-6 (which is sort what the problem states), and also by simulating the layout of tiles (which is what I think the solution implies.) My solution runs the 1000 simulated tile down tests in a about 27 seconds with no exceptions on my workstation.
Is is hard to code to a black box. Can someone please advise on how to deal with this? Shall I post my solution?
created
last reply
- 7
replies
- 568
views
- 4
users
- 1
link