今天没有新动态
@Rohlff

hdu1455 Sticks(dfs)

Sticks 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1455 Problem Description George took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the origin ...
  • 0
  • 117
  • 0
  • 0
@Rohlff

八连通积水(简单DFS)

问题描述 求八连通块。 10 12 W........WW. .WWW.....WWW ....WW...WW. .........WW. .........W.. ..W......W.. .W.W.....WW. W.W.W.....W. .W.W......W. ..W.......W. 如图: ans 为3 思路 遍历map数组,碰到W开始dfs,访问过的标记掉或者直接 ...
  • 0
  • 162
  • 0
  • 0
@Rohlff

部分和(简单dfs)

问题描述: a1,a2,a3...an; 求是否存在一部分使得其和为k;   分析: 加和不加。dfs下潜即可。 题解: #include <iostream> #include <vector> using namespace std; int k,ans; vector<int>vec; //dfs bool dfs(int n,int s ...
  • 0
  • 137
  • 0
  • 0