Rating:

I implemented my own algorithm to detect circles and find the minimum distance, running on $O(wh + n^2)$.

Original writeup (https://www.nevivur.net/writeups/2019/04/tjctf-2019/#sight-at-last).