第二道树形DP,先是MLE.后来仅需改小邻接矩阵的第二个维度到30就过了. #include <cstdio> #include <cstring> #include <cstdlib> #define MAXN 6005 int rat[MAXN]; ]; ]; bool visit[MAXN]; int n; int max(int a, int b) { return a>b ? a:b; } void dfs(int r) { int i, v; visi…
Anniversary party Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 5523 Accepted: 3169 Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure…