Data Structures & AlgorithmsHardICPC regional · algorithm theory
Problem: By the Sprague-Grundy theorem, what is the Grundy value of a sum of independent impartial games?
- A. The sum of their Grundy values
- B. The XOR of their Grundy values
- C. The maximum of their Grundy values
- D. The product of their Grundy values
Correct answer: B. The XOR of their Grundy values
A sum of impartial games has Grundy value equal to the XOR of the component values, which determines the winner.
More Coding Interview Problems questions
- Problem: What is the minimum number of comparisons in the worst case to find both the maximum and the minimum of n = 10 distinct elements…
- Problem: What is the information-theoretic lower bound on comparisons (in the worst case) for sorting 5 distinct elements?
- Problem: Which of the following decision problems is NP-complete?
- Problem: Which statement about the subset-sum problem with target S and n items is correct in the standard sense?
- Problem: Binary lifting on a rooted tree with n nodes uses O(n log n) preprocessing. What is the time for one LCA query?
- Problem: Which statement about building a binary heap from n given elements is correct?