http://www.lydsy.com/JudgeOnline/problem.php?id=2115 边和点可以重复经过,那最后的路径一定是从1到n的一条路径加上许多环 dfs出任意一条路径的异或和.路径上所有环的异或和,加入线性基即可 #include<cstdio> #include<iostream> using namespace std; #define N 50001 #define M 100001 typedef long long LL; int n; ],n…
https://www.lydsy.com/JudgeOnline/problem.php?id=3676 回文自动机模板题 4年前的APIO如今竟沦为模板,,,╮(╯▽╰)╭,唉 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define N 300001 char ss[N]; int s[N]; ,last; int fail[N],len[N],cnt[N…