U41492 树上数颜色

题目描述

给一棵根为1的树,每次询问子树颜色种类数

输入格式

输出格式

说明/提示

对于前三组数据,有 $1\leq m,c[i]\leq n\leq 100$ 而对于所有数据,有$1\leq m,c[i]\leq n\leq 1e5$