随笔分类 -  DFS

hdu 1312Red and Black
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1312题意:就是找从@出发的能经过的'.'的数目。dfs写法:View Code #include<stdio.h>#include<string.h>int col,row;int sx,sy;int sum;int vis[25][25];char map[25][25];void dfs(int x,int y){ if(vis[x-1][y]==0&&map[x-1][y]=='.') { sum++; vis[x-1][y]=1 阅读全文

posted @ 2012-08-05 17:53 仁者无敌8勇者无惧 阅读(217) 评论(0) 推荐(0)

hdu 1016Prime Ring Problem
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1016Prime Ring ProblemTime Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13648Accepted Submission(s): 6220Problem DescriptionA ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n 阅读全文

posted @ 2012-08-03 15:31 仁者无敌8勇者无惧 阅读(401) 评论(0) 推荐(0)

hdu 1241Oil Deposits
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1241Oil DepositsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5360Accepted Submission(s): 3092Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposi 阅读全文

posted @ 2012-08-03 12:06 仁者无敌8勇者无惧 阅读(955) 评论(0) 推荐(0)

导航