代码:
#include <bits/stdc++.h>
using namespace std;
const int maxn=200;
int m,n;
int ans;
int ans2[maxn][maxn];
struct Node
{
int set2[maxn][maxn];
int loc;
int sum;
Node(){};
Node(int _set2[][maxn],int _loc,int _sum)
{
for(int i=1; i<maxn; i++)
{
for(int j=1; j<maxn; j++)
set2[i][j]=_set2[i][j];
}
loc=_loc;
sum=_sum;
};
friend bool operator <(Node a,Node b)
{
return a.sum>b.sum;
}
};
void solve()
{
priority_queue<Node>q;
ans=1e7;
for(int i=0; i<(1<<n); i++)
{
int j=i;
int sum=0;
int vis2[maxn][maxn];
memset(vis2,0,sizeof(vis2));
for(int s=1; s<=n; s++)
{
if(j&1<<(s-1))
{
if(vis2[i][s