Find Metal Mineral Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 3397 Accepted Submission(s): 1588 Problem Description Humans have discovered a kind of new metal mineral on Mars which are d…
#include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<vector> using namespace std; ; int dp[maxn][maxn]; //dp[i][j]表示以i为根,保留j个点的最大权值. int N,Q; int G[maxn][maxn]; int num[maxn]; //以i为根的树的节点个数. //这里…