|
|
back to boardWA on test 17 What the 17 test? why WA? armenia1993@mail.ru int charact(int v) { used[v] = true; vector<int> dp; for (int i=0; i<g[v].size(); ++i) { int to = g[v][i]; if (!used[to]) dp.push_back(charact(to)); } if (dp.size() == 0) return 0; sort(dp.begin(), dp.end()); for (int i=dp.size(); i>0;--i) dp[i-1] += dp.size() - i + 1; return *max_element(dp.begin(), dp.end()); } |
|
|