B1
3个答案取min

B2
模拟

B3

S1
S2
S3

G1
离线处理所有询问
按深度从大到小排序

需要用双向链表或者并查集维护最大的间隔

G2
树形动态规划,直接计数即可

G3
动态规划
f[i][j][k]

P1
P2
P3

wwwwodddd Uncategorized

Leave a Reply

Your email address will not be published. Required fields are marked *