Data Structures & AlgorithmsHardCodeforces Div2 B-D · ICPC regional
How many ordered pairs (x, y) with 1 <= x, y <= 12 have x * y divisible by 12?
- A. 40
- B. 41
- C. 39
- D. 12
Correct answer: A. 40
Enumerate all 144 ordered pairs and test divisibility. The count is larger than the number of multiples of 12 alone because products can contain 2 and 3 separately.
Practise more Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questionsArrays, Strings, Linked Lists, Stacks, Queues and Hashing: notes and key points
More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions
- From the multiset [6, 1, 4, 2, 5, 3], choose as many elements as possible (order irrelevant) with total at most 10. What is the maximum…
- How many times does "ab" occur as a substring of the string "aab" repeated three times?
- How many distinct values arise as a sum of two different elements (by position) of [3, 5, 8, 10]?
- For [1, 3, 2, 4, 6, 5, 7], how many positions already hold their correct value in the sorted array?
- How many windows of size 3 in [2, 3, 5, 1, 4, 6, 4] have a sum that is a multiple of 5?
- Sum the popcount of a[i] AND a[j] over all index pairs i < j of [7, 11, 13]. What is the total?