# | User | Rating |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 160 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 151 |
Name |
---|
I don't think so. Informally, you can first place K-1 dominoes in any way you like. Then, if there are two adjacent spots that are both free, you can place the last domino there without decreasing the score. Otherwise, all empty spots are isolated. Pick any two 1x1 spots, then you would like to find a path of adjacent dominoes between these spots that you can 'shift', i.e. do the following operation:
.AABBCC. => XXAABBCC
The question is whether such a path always exists, because it's not always a trivial shortest path, e.g. (where the ? are irrelevant):
Here you cannot pick some shortest path between the two empty spots, so you would need some other route. I can even find an example where there is no path possible between two empty spots (forgetting for a moment that we need an NxN square):
I'm pretty sure there is no "flip path" between the two empty spots on the second row. But of course there are other empty spots (after all, if there were only two empty spots, then 2(K - 1) = N2 - 2, so, 2K = N2, and you can just cover everything), so you'd have to proof that some path always exists.
EDIT: Oh, the rest of the proof is actually quite simple. Try thinking in bipartite graphs :)
I am unable to solve problem C from NEERC, the Cactus Jubilee.
It is clear that what we have to do is essentially find all bridges and compute all cycle lengths and the edges part of every cycle. After that, I think we would have to union the set of disconnected components for finding number of changes to a bridge edge, and for cycle edges, do something similar. But I'm unable to figure out how to do this efficiently. Something to do all this in linear time is something I'm unable to figure out. Please help with clues/ideas.