博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
zoj 1492(最大团)
阅读量:4310 次
发布时间:2019-06-06

本文共 842 字,大约阅读时间需要 2 分钟。

#include 
#include
#include
#include
using namespace std;const int maxn=100;int g[maxn][maxn];int n,cnt,ans;int b[maxn],bb[maxn];void dfs(int x){ if(x>n) { if(cnt>ans) { ans=cnt; memcpy(b,bb,sizeof(bb)); } return; } int flag=1; for(int i=1;i
ans) dfs(x+1);}void init(){ cnt=0; ans=0; memset(b,0,sizeof(b)); memset(bb,0,sizeof(bb)); memset(g,0,sizeof(g));}int main(){ while(~scanf("%d",&n)&&n) { init(); for(int i=1;i<=n;i++) for(int j=1;j<=n;j++) scanf("%d",&g[i][j]); dfs(1); printf("%d\n",ans); } return 0;}

 

板子

转载于:https://www.cnblogs.com/Wangwanxiang/p/7642692.html

你可能感兴趣的文章
VS2013 添加已有文件夹
查看>>
摄影扫盲
查看>>
POJ 2388 - Who's in the Middle
查看>>
python 计时程序运行时间
查看>>
【最小生成树+贪心】BZOJ1821: [JSOI2010]Group 部落划分 Group
查看>>
ios-自动布局指南:入门
查看>>
【Shell脚本学习4】几种常见的Shell
查看>>
DataStructure part1 基础概念
查看>>
201521123007《Java程序设计》第11周学习总结
查看>>
BitLocker 加密工具挂起和恢复命令行(windows7)
查看>>
VMware下centos7安装VMware Tools
查看>>
Eclipse下Android开发的问题:Failed to install AndroidPhone.apk on device 'emulator-5554': timeout 解决办法...
查看>>
[luogu_P2045]方格取数加强版
查看>>
android 代理模式创建Activity
查看>>
c++课程设计之菜单选择\\
查看>>
iOS 的 XMPPFramework 简介
查看>>
hdu 3555 数位dp入门
查看>>
Git学习系列-Git基本概念
查看>>
c#多个程序集使用app.config 的解决办法
查看>>
模仿网站登录注册
查看>>