printer.cpp:6:1: error: expected ',' or ';' before 'struct'
6 | struct Trie {
| ^~~~~~
printer.cpp:10:3: error: 'tr' does not name a type; did you mean 'tm'?
10 | } tr[MAXN];
| ^~
| tm
printer.cpp: In function 'void add(int, const string&)':
printer.cpp:18:13: error: 'tr' was not declared in this scope; did you mean 'tm'?
18 | if (tr[cur].child[c] == 0) {
| ^~
| tm
printer.cpp:21:15: error: 'tr' was not declared in this scope; did you mean 'tm'?
21 | cur = tr[cur].child[c];
| ^~
| tm
printer.cpp:23:5: error: 'tr' was not declared in this scope; did you mean 'tm'?
23 | tr[cur].cnt++;
| ^~
| tm
printer.cpp: In function 'void query1(int)':
printer.cpp:29:12: error: 'tr' was not declared in this scope; did you mean 'tm'?
29 | while (tr[root].cnt--) {
| ^~
| tm
printer.cpp:34:13: error: 'tr' was not declared in this scope; did you mean 'tm'?
34 | if (tr[root].child[i] == 0) continue;
| ^~
| tm
printer.cpp:35:13: error: 'tr' was not declared in this scope; did you mean 'tm'?
35 | if (tr[tr[root].child[i]].h > u) {
| ^~
| tm
printer.cpp:41:13: error: 'tr' was not declared in this scope; did you mean 'tm'?
41 | if (tr[root].child[i] == 0 || i == v) continue;
| ^~
| tm
printer.cpp:43:16: error: 'tr' was not declared in this scope; did you mean 'tm'?
43 | query1(tr[root].child[i]);
| ^~
| tm
printer.cpp:48:16: error: 'tr' was not declared in this scope; did you mean 'tm'?
48 | query1(tr[root].child[v]);
| ^~
| tm
printer.cpp: In function 'void query(int, int)':
printer.cpp:54:5: error: 'tr' was not declared in this scope; did you mean 'tm'?
54 | tr[root].h = max(tr[root].h, u);
| ^~
| tm