hdu2614 DFS
来源:互联网 发布:京东配送员工资算法 编辑:程序博客网 时间:2024/05/23 11:47
#include <iostream>#include <cstdio>#include <cmath>#include <algorithm>#include <cstring>#include <queue>using namespace std;int f[20][20],flag[20];int ans;int n;void DFS(int now,int tim,int maxx){ ans=max(ans,maxx); if(ans==n) return ; for(int i=1;i<n;i++){ if(f[now][i]>=tim && i!=now){ if(!flag[i]){ flag[i]=1; DFS(i,f[now][i],maxx+1); flag[i]=0; } } }}int main(){ // freopen("in.txt","r",stdin); while(scanf("%d",&n)!=EOF){ ans=1; for(int i=0;i<n;i++) for(int j=0;j<n;j++){ scanf("%d",&f[i][j]); } memset(flag,0,sizeof(flag)); flag[0]=1; DFS(0,0,1); printf("%d\n",ans); } return 0;}
0 0
- hdu2614 DFS
- HDU2614 DFS
- hdu2614(dfs)
- hdu2614:Beat(dfs)
- hdu2614 Beat 简单dfs
- hdu2614 Beat--DFS
- 【hdu2614】Beat——dfs
- hdu2614 Beat BFS or DFS
- hdu2614 Beat(简单dfs)
- hdu2614
- HDU2614
- HDU2614
- hdu2614
- ACM-DFS之Beat——hdu2614
- HDU2614 Beat
- HDU2614 Beat
- hdu2614之简单搜索
- DFS
- android常用特效链接
- 【poj3620】Avoid The Lakes
- Python之scatter散点图函数
- 设计模式总结(面试必问二)
- Unity 一条线在另一条线的投影
- hdu2614 DFS
- thingking in java test2.11(11)
- [Cloud Computing]Mechanisms: Virtual Server State Manager
- poj (3083) Children of the Candy Corn
- Nyist125 盗梦空间
- ECshop二次开发细节
- 变形课<hdoj1181>
- 大数据背后的神秘公式:贝叶斯公式
- HDOJ-----2553N皇后问题