/**
[字典树] hdu 1800 fly to the mar
开始以为求出最多有多少个单调序列,这个真不会,发现是求众数。
先map了一下,直接tle了。
然后字典树,注意1,去掉前导0;2,如果是0,要保留一个。
*/
#include <stdio.h>
#include <string>
#include <string.h>
#include <iostream>
#include <map>
#include <algorithm>
using namespace std;
#define N 3000
#define MAXN 100000
struct tireTree
{
int cnt;
tireTree *child[10];
}tt[MAXN],*spt;
void insert(char *s,tireTree *&rt)
{
int num,i;
tireTree *loc;
loc = rt;
for(i = 0; s[i]; ++i)
{
num = s[i] - '0';
if(loc -> child[num] == NULL)
loc -> child[num] = spt++;
loc = loc