题目简述:给定一个$n \times m$的二维矩阵$a[i][j]$,其中$1 \leq nm \leq 2 \times 10^5$,矩阵元素$1 \leq a[i][j] \leq nm$且互不相等。一个区间$[l, r]$是【好】的,如果所有在$[l, r]$范围内元素(在平面上)构成了一棵树。求【好】区间$[l, r](1 \leq l \leq r \leq nm)$的个数。
解:code
CodeForces 1109F. Sasha and Algorithm of Silence's Sounds
原文:https://www.cnblogs.com/TinyWong/p/10405580.html