Data Structures & AlgorithmsHardCodeforces Div2 B-D · ICPC regional
What is the sum of all positive divisors of 36?
- A. 91
- B. 90
- C. 97
- D. 108
Correct answer: A. 91
Use the multiplicative formula: 36 = 2^2 * 3^2 so sigma = (1+2+4)(1+3+9) = 7 * 13 = 91. Adding the divisors one at a time gives the same value.
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
- How many contiguous subarrays of [2, 4, 1, 3] have a sum in the inclusive range [4, 6]?
- How many distinct subsequences (including the empty string) does "aab" have?
- How many pairs (a, b) with 1 <= a <= b <= 20 satisfy a b = 36?
- For [4, 1, 3, 2, 5], each index i gets the index of its previous strictly greater element (or -1 if none). What is the sum of these values…
- How many windows of size 3 in [5, 2, 7, 3, 1, 6, 4] have their minimum exactly at the middle position?
- Five lectures are the half-open intervals [1,2), [2,5), [4,6), [5,8), [7,9). How many lectures can be attended without overlap (touching…