http://codeforces.com/contest/839/problem/E

最大团裸题= =,用Bron–Kerbosch算法,复杂度大多博客上没有,维基上查了查大约是O(3n/3)

最大团: V中取K个顶点,两点间相互连接

最大独立集: V中取K个顶点,两点间不连接

最大团数量 = 补图中最大独立集数

//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast,no-stack-protector")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pi acos(-1.0)
#define ll long long
#define mod 1000000007
#define C 0.5772156649
#define ls l,m,rt<<1
#define rs m+1,r,rt<<1|1
#define pil pair<int,ll>
#define pii pair<int,int>
#define cd complex<double>
#define ull unsigned long long
//#define base 1000000000000000000
#define fio ios::sync_with_stdio(false);cin.tie(0) using namespace std; const double g=10.0,eps=1e-;
const int N=+,maxn=+,inf=0x3f3f3f3f,INF=0x3f3f3f3f3f3f3f3f; int ans,cnt[N],group[N],vis[N];
int n,a[N][N];
bool dfs(int u,int pos)
{
printf("%d---%d----%d\n",u,pos,ans);
for(int i=u+;i<=n;i++)
{
printf("%d###%d\n",cnt[i],i);
if(cnt[i]+pos<=ans)return ;
if(a[u][i])
{
int j;
for(j=;j<pos;j++)if(!a[i][vis[j]])break;
printf("%d++++\n",j);
if(j==pos)
{
vis[pos]=i;
if(dfs(i,pos+))return ;
}
}
}
if(pos>ans)
{
for(int i=;i<pos;i++)group[i]=vis[i];
ans=pos;
return ;
}
return ;
}
void maxclique()
{
ans=-;
for(int i=n;i;i--)
{
vis[]=i;
dfs(i,);
cnt[i]=ans;
printf("%d!!!\n",cnt[i]);
}
}
int main()
{
int k;
scanf("%d%d",&n,&k);
for(int i=;i<=n;i++)
for(int j=;j<=n;j++)
scanf("%d",&a[i][j]);
maxclique();
// printf("%d\n",ans);
printf("%.12f\n",1.0*k/ans*k/ans*ans*(ans-)/);
return ;
}
/******************** ********************/

Codeforces Round #428 (Div. 2)E. Mother of Dragons的更多相关文章

  1. CodeForces 839C - Journey | Codeforces Round #428 (Div. 2)

    起初误以为到每个叶子的概率一样于是.... /* CodeForces 839C - Journey [ DFS,期望 ] | Codeforces Round #428 (Div. 2) */ #i ...

  2. CodeForces 839D - Winter is here | Codeforces Round #428 (Div. 2)

    赛后听 Forever97 讲的思路,强的一匹- - /* CodeForces 839D - Winter is here [ 数论,容斥 ] | Codeforces Round #428 (Di ...

  3. CodeForces 839B - Game of the Rows | Codeforces Round #428 (Div. 2)

    血崩- - /* CodeForces 839B - Game of the Rows [ 贪心,分类讨论] | Codeforces Round #428 (Div. 2) 注意 2 7 2 2 2 ...

  4. Codeforces Round #428 (Div. 2) 题解

    题目链接:http://codeforces.com/contest/839 A. Arya and Bran 题意:每天给你一点糖果,如果大于8个,就只能给8个,剩下的可以存起来,小于8个就可以全部 ...

  5. Codeforces Round #428 (Div. 2) D. Winter is here 容斥

    D. Winter is here 题目连接: http://codeforces.com/contest/839/problem/D Description Winter is here at th ...

  6. 【Codeforces Round #428 (Div. 2) B】Game of the Rows

    [Link]:http://codeforces.com/contest/839/problem/B [Description] 给你n排的如题目所示的位置; 同一排中(1,2) 算相邻; (3,4) ...

  7. 【Codeforces Round #428 (Div. 2) C】Journey

    [Link]:http://codeforces.com/contest/839/problem/C [Description] 给一棵树,每当你到一个点x的时候,你进入x的另外一每一个出度的概率都是 ...

  8. Codeforces Round #428 (Div. 2)A,B,C

    A. Arya and Bran time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

  9. Codeforces Round #428 (Div. 2)

    终于上蓝名了,hahahahaha,虽然这场的 B 题因为脑抽了,少考虑一种情况终判错了,还是很可惜的.. B题本来过来1500个人,终判之后只剩下了200多个,真的有毒!!!! A - Arya a ...

随机推荐

  1. 20165324《Java程序设计》第一周

    20165324<Java程序设计>第一周学习总结 教材学习内容总结 第一章:Java入门 重点一.编写Java程序 第一步编写源文件,(注:第一步中Java严格区分大小写:Java源文件 ...

  2. ECMAScript与JavaScript

    ECMAScript发展史: 1997 1998.6 1999.12 2008.7 2009.12 2015.61996年11月 javaScript创造者Netscape公司将javaScript提 ...

  3. 有关RDD的基础学习1

    1.spark rdd为什么不能嵌套?    譬如 val rdd1=sc.parallel(range(1,100))    val rdd2=sc.parallel(range(1,100))   ...

  4. Python之路——堡垒机原理及其简单实现

    1 堡垒机基本概述 其从功能上讲,它综合了核心系统运维和安全审计管控两大主干功能,从技术实现上讲,通过切断终端计算机对网络和服务器资源的直接访问,而采用协议代理的方式,接管了终端计算机对网络和服务器的 ...

  5. 【web Api性能提升技巧】(2)从DataReader手工创建Json字符串

    这个思路是从 一篇文章,关于<提升web api的性能>上看到的.自己实践了一番,写下步骤. 传统的DataReader是遵循这样的一个步骤: While(reader.Read()) { ...

  6. 【npm】使用淘宝提供的镜像来加速npm

    国外的npm用着非常不稳定,时常一直就卡在安装的进度条上 淘宝提供了一个国内镜像,保障了安装网络环境的稳定,和源地址10分钟同步一次,没有被收录的包会自动切换到npm官方下载,并添加进镜像库. 地址: ...

  7. 基于Python操作redis介绍

    (注:本文部分内容摘自互联网,由于作者水平有限,不足之处,还望留言指正.) 毕业前的最后一个学期(2016.03),龙哥结婚了.可是总有些人喜欢嘲笑别人,调侃我.当时我就理直气壮的告诉他们,等龙哥孩子 ...

  8. Decker容器使用

    Docker 客户端 我们可以直接输入 docker 命令来查看到 Docker 客户端的所有命令选项 root@ranxf:/home/ranxf# docker Usage: docker COM ...

  9. Web安全学习笔记之Nmap脚本编写

    0x00 Nmap脚本简介 夜无眠,看了一下Nmap官方的英文API文档(全是English),瞬间心态崩塌,不想吐槽它们的nmap官网前端太丑了=.=,但是都是大牛啊,挺敬佩开源开发者的. Nmap ...

  10. android - Session 'app': Error Installing APK

    File->Settings->Build,Execuion,Deployment->Instant Run 然后把Enable Instant Run to...那一项的勾去掉就好 ...