problem solution codes //f[i,j]表示用j秒回到i最多拿幾幅畫
//鏈式建樹
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 1010;
int tot, n(1), f[maxn][maxn];//n是節點編號
void dp(int root){int time, pic;cin>>t
problem solution codes //MST-Kruskal-排序貪心+并查集
//題中N=M,(M小于N^2的)稀疏圖用鄰接表。
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long LL;
const int maxn = 100010;struct Edge{ int u, v, w; }e[maxn