#include<bits/stdc++.h> using namespace std; const int maxn = 1000005; char ans[20] = {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'}; int nexts[maxn]; void get_next(char t[]) { nexts[0] = -1; int i = 0, j = -1; while(i < strlen(t)) { if(j == -1 || t[i] == t[j]) { ...