aajjbb's blog

By aajjbb, 10 years ago, In English

Hello, today I've found an interesting problem in Live Archive Link. Suddenly I noticed that it's very similar to an old problem form the brazilian version of spoj Link which I also never managed to solve.

My first solution for the first problem is a simple brute-force (with a low constraint 'N <= 10') I thought it was feasible. But this full brute-force O(N!*6^N) clearly exceeded the time limits.

Explaining my brute-force solution, I try all possible permutations orders for the prisms and then, backtrack on it's biggest pyramid possible (trying all it's faces)

Could you give me some ideas on how to solve it in time ?

  • Vote: I like it
  • 0
  • Vote: I do not like it