按层dp,f[i][j]表示已扩展i子集的节点当前在第j层的最小代价,预处理点集间距离即可. #include<iostream> #include<cstdio> #include<cmath> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define N 12 #define i…
题目:https://www.luogu.org/problemnew/show/P3959 原来写了个不枚举起点的状压dp. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #define ll long long using namespace std; ,M=(<<)+,INF=0x3f3f3f3f; int n,m,lm,b[N][N],d…