AtCoder Grand Contest 035 - Problem-Solving Report
Consider trying every order of the only \(s \leq 3\) elements and then checking, and you're done.
Continue reading →Chinese original · English translation by Claude Opus 5.5
Consider trying every order of the only \(s \leq 3\) elements and then checking, and you're done.
Continue reading →Chinese original · English translation by Claude Opus 5.5
Just place the triangle at a slant.
Continue reading →Chinese original · English translation by Claude Opus 5.5
Of these 3000+ problems, this is the most refreshingly clean one I've done.
The first thing you can surely think of: after prime factorization, for a \(p^c\), take every element's exponent of that prime and take the median, and that gives this prime's contribution. That's roughly where my mind went blank.
Continue reading →Chinese original · English translation by Claude Opus 5.5
Consider letting \(S = \oplus_{i = 1}^n a_i\), then throw \(c_i = a_i \oplus b_i\) into a linear basis. We can see that the linear basis, with the fewest numbers, pieces together a number equal to \(S\), which makes the position a guaranteed loss. Then the probability of winning is \(1 - (\frac12)^{siz}\).
Of course, if it can't be pieced together, then it's a sure win.
Continue reading →Chinese original · English translation by Claude Opus 5.5
Fuck, this problem is genuinely interesting (once you've solved it, it's utterly bland).
This problem is bitmask DP for sure, no way around it, so we can first let \(f[S]\) be the minimum cost of making the set \(S\) biconnected. Doing it directly is a bit hard; we need to think of an inductive way to construct a biconnected graph.
Continue reading →Chinese original · English translation by Claude Opus 5.5
This problem is pretty brain-dead, so I'll just post the figure from the editorial:
Continue reading →Chinese original · English translation by Claude Opus 5.5
A brain-dead problem; just consider the two ends and the parity.
Continue reading →Chinese original · English translation by Claude Opus 5.5
At first glance there's no way to maintain the maximum vertex-weight sum on a graph, but notice that there are no edge deletions, and notice that a biconnected component can be contracted into a single vertex, so we can use an LCT to maintain the biconnected components.
Consider keeping two DSUs: one is the DSU of biconnected components, labeled \(0\); the other is a DSU that maintains connectivity, labeled \(1\).
Continue reading →Chinese original · English translation by Claude Opus 5.5
First, setting the original problem aside and considering only the optimal strategy: clearly, the longer the string we can currently match, the better. So we can consider binary searching on the answer: compute the longest string that can be assembled with the current number of appends, then compare it with \(n\).
Continue reading →Chinese original · English translation by Claude Opus 5.5
Brain-dead problem. Consider that the final path must be a concatenation of several black and white sub-paths, so the cost of the path is the number of times it enters a black sub-path, so all we need is to give the edges going from white into black a weight of \(1\) when building the graph.
Continue reading →Chinese original · English translation by Claude Opus 5.5