Data Structures & AlgorithmsVery hardCodeforces Div2 B-D · ICPC regional
What is the floor of the square root of the sum of [1000, 2500, 900]?
- A. 66
- B. 67
- C. 65
- D. 440
Correct answer: A. 66
The sum is 4400, and floor(sqrt(4400)) = 66 because 66^2 = 4356 and 67^2 = 4489. Floating point square roots can be off by one near perfect squares, so an integer search is preferred.
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 indices i in "xyzxyzxyz" satisfy s[i] = s[i + 3]?
- A singly linked list holds 1..7. Using the slow/fast pointer method, the slow pointer reaches the middle node. How many nodes come after…
- What is the minimum number of elements to delete from [1, 1, 1, 2, 2, 2, 2, 3] so that every value appears at most twice?
- Group the values [1, 2, 4, 5, 6, 9, 10] so that consecutive sorted values with difference at most 1 share a group. How many groups result?
- How many ordered triples of positive integers (x, y, z) satisfy x + y + z = 10?
- Replacing at most one character, what is the length of the longest substring of "abcbbbcaa" that can be made into a single repeated letter?