Lang:G++
Edit12345678910111213141516171819202122232425262728293031/* ***********************************************Author :Kylin_lhyCreated Time :2017年05月13日 星期六 15时15分35秒File Name :403fob.cpp************************************************ */#include <bits/stdc++.h>using namespace std;#define m0(x) memset(x,0,sizeof(x))#define mff(x) memset(x,0xff,sizeof(x))#define fi first#define se secondtypedef long long ll;const ll mod=1e9+7;const ll maxn=1e5+7;const ll maxe=1e6+7;const ll INF=1e9+7;const double eps=1e-8;int dx[4]={0,0,1,-1};int dy[4]={-1,1,0,0};int T;const int max_word = 1e6+7;const int sigma_size = 2;const int max_text = 1000;struct Trie{int next[max_word][sigma_size], end[max_word];int root, L;int newnode(){for(int i = 0; i < sigma_size; i++) next[L][i] = -1;end[L++] = INF;