摘要: 时间复杂度:dfs为 ,dfs过程中处理所有查询对为 ,总时间复杂度 cpp include include using namespace std; const int maxn=500010, maxm=500010; int N, M, S, tot, h[maxn], v[maxn], fa 阅读全文
posted @ 2019-03-14 17:04 LFYZOI题解 阅读(309) 评论(0) 推荐(0) 编辑
摘要: 时间复杂度: dfs树,求st表(状态数组f):O(NlgN) 处理M个查询:O(MlgN) 总:O((M+N)lgN) cpp include include include using namespace std; const int maxn=500010; struct edge{ int 阅读全文
posted @ 2019-03-14 16:15 LFYZOI题解 阅读(334) 评论(0) 推荐(0) 编辑