hdu 2164 Beat
来源:互联网 发布:mac地址由什么组成 编辑:程序博客网 时间:2024/05/21 19:41
/* ***********************************************Author :xryzEmail :523689985@qq.comCreated Time :4-9 22:30:18File Name :Beat.cpp************************************************ */#include <stdio.h>#include <string.h>#include <iostream>#include <algorithm>#include <vector>#include <queue>#include <set>#include <map>#include <string>#include <math.h>#include <stdlib.h>#include <time.h>using namespace std;int n,mp[20][20],vis[20],ans;void dfs(int now,int data,int cnt){ if(now==n) return; ans=max(ans,cnt); for(int i=0;i<n;i++) { if(vis[i]) continue; if(mp[now][i]>=data) { vis[i]=1; dfs(i,mp[now][i],cnt+1); vis[i]=0; } }}int main(){ while(~scanf("%d",&n)) { for(int i=0;i<n;i++) for(int j=0;j<n;j++) scanf("%d",&mp[i][j]); ans=0; memset(vis,0,sizeof(vis)); vis[0]=1; dfs(0,0,1); printf("%d\n",ans); } return 0;}
0 0
- hdu 2164 Beat
- hdu 3581 Beat It!
- hdu 2612 Beat
- hdu(2614) Beat
- HDU 2614 Beat (dfs)
- hdu 2614 Beat
- HDU 2614 Beat
- hdu 2614 Beat
- HDU 2614 Beat
- hdu 2614 beat
- HDU 2614 Beat (DFS)
- hdu 2614 Beat
- HDU 2614 Beat
- HDU - 2614 Beat
- HDU:2614 beat
- HDU 2614.Beat
- 杭电 hdu 2614 Beat
- HDU 1194 Beat the Spread!
- Fragment详解之五——Fragment间参数传递
- 汇编学习之路之DS
- 脏读 幻读 不可重复读
- 猜数字
- PHP设计模式——简单工厂
- hdu 2164 Beat
- 一个简单的排序小算法
- 基因牛
- 每个程序员都必须遵守的编程原则
- Java Enum 枚举类型
- 奇怪的分式
- Shell入门:掌握Linux,OS X,Unix的Shell环境
- Android 自定义ListView
- Hdoj 1024 Max Sum Plus Plus 【DP】