摘要:
/* Company Queries II https://cses.fi/problemset/task/1688/ 这题就是求lca的模板题 下面代码用倍增法 */ #include <bits/stdc++.h> using namespace std; const int N=2e5+10; 阅读全文
摘要:
这道题需要把单词看成有向图的边,单词的首字母和尾字母当做点,这样就能建立有向图 另外,这题需要打印边的编号,而不是点的编号,所以dfs时候需要push边的编号 #include <bits/stdc++.h> using namespace std; const int N=1e3+10; int 阅读全文