Search found 6 matches

by solver
Wed Nov 13, 2002 3:01 pm
Forum: Volume 102 (10200-10299)
Topic: 10232 - Bit-wise Sequence
Replies: 12
Views: 5559

How did you attached primes to this problem?
May be you have mixed up some problems?

You are right. I mixed up this problem with another one I saw. And misreading this one, I assumed one has to form a list of prime numbers in ascending order of B(n). That was confusing me a lot. :)

Now that the ...
by solver
Tue Nov 05, 2002 9:37 am
Forum: Algorithms
Topic: Generating Combinations
Replies: 5
Views: 4478

:) Thanks.
by solver
Tue Nov 05, 2002 8:22 am
Forum: Algorithms
Topic: Generating Combinations
Replies: 5
Views: 4478

Obviously I have arrays with nonconstant lengths, and you can make them constant or dynamically allocate them, your call.

:) Thanks for your reply.

How about using std::map<int,bool> taken; instead of bool taken[ totalitemcount ]; ? (not sure if thats an overkill ... or may even hurt performance ...
by solver
Sat Nov 02, 2002 5:10 am
Forum: Algorithms
Topic: Generating Combinations
Replies: 5
Views: 4478

Generating Combinations

I usually generate combinations using this method:

If I have to generate combinations of k out of n elements, I loop from 0 to 2^n-1 and count the number of 1s in each iteration's bin. representation. If the number of 1s=k, I pick it and the positions with 1s are considered IN and others OUT. This ...
by solver
Sat Nov 02, 2002 2:08 am
Forum: Volume 102 (10200-10299)
Topic: 10232 - Bit-wise Sequence
Replies: 12
Views: 5559

10232 -- is this the method?

I've been thinking about 10232 (Bitwise Sequence), and the only way I could think of doing it was to

Taking 2 to be the only prime number with one 1 in its bin. representation,

1. generate all combinations of two 1s (with 1 in the last placeholder, as even numbers are not to be checked), and ...
by solver
Mon Oct 28, 2002 7:25 pm
Forum: Volume 102 (10200-10299)
Topic: 10232 - Bit-wise Sequence
Replies: 12
Views: 5559

umm... I'm feeling quite clueless attempting this problem. :roll:

Go to advanced search