poj 2513 Colored Sticks

// 判断图是否联通 在连通的基础上还要判断是否存在欧拉通路
// 判断连通就并查集了 判断是否存在欧拉通路: 点度数为数的点 ==1 >=3就是不存在的 其它是存在的
// 我开始用 map 判重 然后就悲剧了一上午 好久没写 Trie树了 都忘了、

#include <iostream> #include <string> #include <map> #include <algorithm> #include <queue> #include <math.h> #include <stdio.h> #include <string.h> #include <vector> using namespace std; #define MOD 1000000007 #define maxn 500100 char s1[20],s2[20]; int d[maxn];//,out[maxn]; int f[maxn],num[maxn]; int Fin(int x){ if(x!=f[x]) f[x]=Fin(f[x]); return f[x]; } int sz; int ch[maxn][26]; int val[maxn]; int idx(char c){ return c-'a';} void insert(char *s,int v){ int u=0;//,len=strlen(s); int c; for(int i=0;s[i]!='