aising2019C
https://gyazo.com/6eb7e020e386120d4b5fa5a5331e74af
Thoughts.
When adjacent squares are of different colors, they are good walls to pass through.
This relationship is symmetric
That is, the connected component of an undirected graph
UnionFind then triangle number
Official Explanation
Missed the "black and white pair."
I thought it was two arbitrary points.
Black x white" instead of triangular numbers
---
This page is auto-translated from /nishio/aising2019C using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. I'm very happy to spread my thought to non-Japanese readers.