前言
好像这个叫组内最大团 ? 传送门 :
思路d f s dfs dfs分析当前节点
- 新开一组,放到新的组里
- 使用之前开过的组
因此我们直接按照题意DFS即可 (怎么说呢?
CODEbool check(int g[],int gc,int num)
{
for(int i = 0 ;i1)
return false;
return true;
}
void dfs(int g,int gc,int tc,int start)
{
if(g>=ans)
return;
if(tc == n)
ans = g;
bool flag = true;
for(int i =start;i>n;
ans = n ;
for(int i = 0;i>p[i];
dfs(1,0,0,0);
cout
关注
打赏