11446 - Where is the 'back' button?
Moderator: Board moderators
Re: 11446 - Where is the 'back' button?
Oh, no wonder I couldn't find any faster algorithm. I thought of a bruteforce O(n*2^n) algorithm long time ago, but thought that the time limit is too tight for it. Now I see that I can use bitmask to make it O(2^n), which should be fast enough.
Re: 11446 - Where is the 'back' button?
Hi,
Nevermind...
Nevermind...
-
- New poster
- Posts: 33
- Joined: Fri Jan 06, 2006 5:51 pm
Re: 11446 - Where is the 'back' button?
I don't quite understand what you mean by this, can you elaborate more please?We choose some leaves and make sure every node could reach at least one of them.
(and choose some roots to make sure every node could be reached from them)