|
|
back to boardI've solved this problem in O(n) time, with O(n) of memory. Where n - length of the answer (in this problem it's not more than 100) Constants are very big, but solution is really linear =) Memory: 8^3*9^3 + n*9*150 Time: (8^3*9^3 + n*9*150)*9 If you are a teacher your work first of all is to generate tests which crach slow and wrong solutions. As teacher I (IMHO) should help people who want to learn smth new. Btw, "Teacher30" is only my nickname. My true name is Sergey Kopeliovich. The last. Last 10-15 submissions are variations of this theme. Edited by author 17.11.2008 14:10 Really interesting question. Who is Burunduk1? Or you were renumbered few years ago? =) I think I understand your method :) Edited by author 11.12.2008 20:20 |
|
|