poj 3630
题意:给出n个串,问是否存在两个串,使得一个串是另一个串的前缀
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
const int N=1e5+10;
const int Z=10;
int T,n,tot;
int ch[N][Z];//数组存储trie树
bool bo[N];
char s[20];
void clear()//初始化
{
memset(ch,0,sizeof ch);
memset(bo,false,sizeof bo);
}
bool insert(char *s)//插入一个字符串 同房时判断答案
{
int len=strlen(s);
int u=1;
bool flag=false;
for(int i=0;i<len;++i)
{
int c=s[i]-'0';
if(!ch[u][c])
ch<