[CTSC1997]选课
题面题解树形背包板子题。设\(f[i][j]\)表示在以\(x\)为根的子树选\(j\)门课(包括\(x\))能够获得的最高学分,用分组背包转移即可。代码#include<cstdio>#include<vector>#define RG registerinline int read(){ int data = 0, w = 1; ch...