摘要:
时间复杂度:dfs为 ,dfs过程中处理所有查询对为 ,总时间复杂度 cpp include include using namespace std; const int maxn=500010, maxm=500010; int N, M, S, tot, h[maxn], v[maxn], fa 阅读全文
摘要:
时间复杂度: 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 阅读全文