G. Vlad and the Mountains

G. Vlad and the Mountains https://codeforces.com/contest/1851/problem/G 离线+并查集 首先观察路径 \(i \to j\to k\) 其必须满足如下条件: \(h_j-h_i\leq e\) \(h_k-h_j\leq e -
posted @ 2024-06-28 01:59  jackle  阅读(1)  评论(0编辑  收藏  举报