#include <bits/stdc++.h> using namespace std; typedef long long ll; const int N = 20, M = N * N; ll h[N], e[M], ne[M], w[M], idx; ll n,m; ll res = 0; bool vis[N]; void add(ll a, ll b, ll c) { e[idx] = b, ne[idx] = h[a], w[idx] = c, h[a] = idx++; } void dfs(ll u, ll len) { res = max(res, len); ...