№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 3985 |
2 | jiangly | 3741 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3489 |
7 | Radewoosh | 3483 |
8 | Kevin114514 | 3442 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
2 | atcoder_official | 162 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
Название |
---|
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.