F - Tournament
Basic Information
Contest | The 2018 ICPC Asia Qingdao Regional Contest |
Team AC Ratio | 114/373 (30.6%) |
Tutorial
If you only aim at solving the problem, you can calculate the first few answers and look for the pattern. You can see that there must be \(k \leq \text{lowbit}(n) - 1\) in order for there to be a solution, and in the \(i\)-th round of the competition (\(i\in [1, k]\)), player \(j\) (\(j \in [0, n-1]\)) will compete against player \(i \oplus j\), where \(\oplus\) denotes the XOR operation. The time complexity is \(\mathcal{O}(nk)\).
For a detailed proof, please refer to IMO 2006 problem C5 (Thanks for hos.lyric).
Solution
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
|