Data Structures & AlgorithmsHardCodeforces Div2 B-D · ICPC regional
Closed meeting intervals [1,3], [3,4], [2,5], [6,7] cannot share a room if they overlap even at one point. What is the minimum number of rooms?
- A. 3
- B. 4
- C. 2
- D. 5
Correct answer: A. 3
Closed intervals sharing an endpoint overlap, so starts are processed before ends at equal times. At time 3 the intervals [1,3], [3,4] and [2,5] all overlap, giving three rooms.
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 inversions does the array [-3, -1, -2] have (pairs i < j with a[i] > a[j])?
- In "abcabdabc", how many positions i >= 1 start an occurrence of the prefix "abc" (the first three characters)?
- What is the sum of all integers from 1 to 50 inclusive that are coprime to 50?
- Let L be the length of the longest common subsequence of "ABCBDAB" and "BDCABA". How many different index-selections in "ABCBDAB" give a…
- What is the length of the longest common subsequence of "dbacabb" and its cyclic rotation by one position (the string with its first…
- Using only insertions and deletions (no substitutions), what is the minimum number of operations needed to turn "heat" into "hit"?