As everyone knows, XG_Zepto is a god from FZOI. He thought the current contests were too easy, so he used his Minesweeper time to set a math problem for kal0rona. kal0rona is way too weak to understand the problem or solve it, so now he's turning to you for help.
Continue reading →Chinese original · English translation by Claude Opus 5.5
Yep, this problem is a nasty problem. First, we can establish that these sequences will all start over from the beginning within \(60s\), because the greatest common multiple of \(1,2,3,4,5,6\) is \(60\). After that, we can consider putting these operations into an operation matrix. The operation matrix is \(n*m\) in both length and width. The specific operations correspond as follows:
Continue reading →Chinese original · English translation by Claude Opus 5.5
At first glance, this can actually be tied to Euler's totient function. What we want is the number of ordered pairs with \(gcd(x,y) \in Prime, x, y \leq N\). Let that prime be \(s\); then it can be rewritten as:
Continue reading →Chinese original · English translation by Claude Opus 5.5
This problem is fairly interesting. At first I came up with an \(O(n^3)\) complexity, and after typing it up and getting TLE I thought about the prefix-difference approach, but I was too naive and didn't quite trust (?) subtraction under the modulus, so I only got this idea working after reading the solutions.
Continue reading →Chinese original · English translation by Claude Opus 5.5