Data Structures & AlgorithmsHardCodeforces Div2 B-D · ICPC regional

In how many ways can 12 be written as a sum of distinct positive odd integers (order does not matter)?

  1. A. 3
  2. B. 4
  3. C. 2
  4. D. 6

Correct answer: A. 3

Enumerate subsets of odd numbers up to 12 by bitmask and count the ones summing to 12. The count is the number of partitions into distinct odd parts.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic