Data Structures & AlgorithmsModerateCodeforces Div2 C · CRT
Problem: The Chinese remainder theorem gives a unique solution modulo M for a system of congruences under which condition?
- A. All moduli are equal
- B. All moduli are even
- C. The moduli are pairwise coprime
- D. All remainders are zero
Correct answer: C. The moduli are pairwise coprime
Pairwise coprimality makes the combined modulus M = product of moduli and gives a unique residue class.
More Coding Interview Problems questions
- Problem: What guarantee does the maximal-matching heuristic give for vertex cover?
- Problem: Which problem is the standard application of the monotonic deque?
- Problem: What is the expected number of random probes needed in open-addressing hashing with load factor alpha under uniform probing…
- Problem: What is the complexity of checking whether a number n is prime by trial division up to sqrt(n)?
- Problem: Edges of an undirected graph on vertices 0–4 are processed in the given order: e1 = 0-1, e2 = 1-2, e3 = 2-3, e4 = 3-4, e5 = 4-0…
- Problem: How many spanning trees does the cycle graph C5 (5 vertices in one cycle) have?