(int x)
| 273 | |
| 274 | // x的子树上,查询所有节点的累加和 |
| 275 | public static long subtreeSum(int x) { |
| 276 | return query(dfn[x], dfn[x] + siz[x] - 1, 1, n, 1); |
| 277 | } |
| 278 | |
| 279 | public static void main(String[] args) throws IOException { |
| 280 | BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); |