题目描述:
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
#define MAXN 66000
int bit[17],n,m,k,f[MAXN];
bool b[17][17];
int main(){
scanf("%d%d%d",&n,&m,&k);
memset(b,0,sizeof b );
for(int x,y,i=1;i<=m;++i){
scanf("%d%d",&x,&y);--x,--y;
b[x][y]=b[y][x]=1;
}
memset(f,127/3,sizeof f );
for(int i=0;i<(1<<n);++i){
int s=0;
for(int j=0;j<n;++j)
for(int k=0;k<n;++k)
if(i&(1<<j)&&(i&(1<<k)))
if(b[j][k]) ++s;
s/=2;
if(s<=k) f[i]=1;
for(int j=i;j;j=(j-1)&i)
f[i]=min(f[i],f[j]+f[i^j]);
}
printf("%d\n",f[(1<<n)-1]);
return 0;
}