On 12/25/05, Arunachalam <[EMAIL PROTECTED]> wrote:
I dont think, this is because of python.
 
Start searching for good perms for right and with some optimizations in for loop and recursion.

Did you mean "from" the right? 

I used this idea and solved this problem, (ofcourse I used C)
 
regards
Arunachalam.

 
On 12/24/05, Rave Hanker <[EMAIL PROTECTED] > wrote:
Hello,
I came across this prob. acm.mipt.ru/judge. Well a good permutation for any number n in a permutation containing 2...n+1 where each A[i] is divisible by i for 1<=i<=n. The problem is to find all Good pems. I tried two techniques
1. Dynamic programming where in i build from the left and exclude invlaid perms
2. Constraint Programming..where i have a list of allowed domains and solve by backtracking and constraint propogation.

But i got a time limit error(5 secs limit) for both of them. I coded all these in Python. Is the error because of the language(being an intepreted one) or with my approach itself.

I'd be happy if somebody comes out with a few suggestion...

--
Well," said Owl, "the customary procedure in such cases is as follows."
"What does Crustimoney Proseedcake mean?" said Pooh. "For I am a Bear of Very Little Brain, and long words Bother me."
"It means the Thing to Do."
"As long as it means that, I don't mind," said Pooh humbly.



--
===================================
want to know more about me
http"//ww.livejournal.com/users/arunachalam



--
Well," said Owl, "the customary procedure in such cases is as follows."
"What does Crustimoney Proseedcake mean?" said Pooh. "For I am a Bear of Very Little Brain, and long words Bother me."
"It means the Thing to Do."
"As long as it means that, I don't mind," said Pooh humbly.

Reply via email to