转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud
需要求出按题目要求建四叉树所需的结点个数,和压缩后的四叉树的结点个数(压缩即只要将相同的子树只取一颗即可),在此,我用string表示一颗子树。
读取好数据之后,直接dfs一遍即可
poj题目链接:http://poj.org/problem?id=1623
shuoj题目链接:http://202.121.199.212/JudgeOnline/problem.php?id=1701
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1 /********************************* 2 * Built using CHelper plug-in 3 * Actual solution is at the top 4 * @author xyiyy @ http://www.cnblogs.com/fraud/ 5 *********************************/ 6 7 #include <iostream> 8 #include <cstring> 9 #include <map> 10 #include <cstdio> 11 using namespace std; 12 int number[10]; 13 char a[1030][1030]; 14 int col,row; 15 map<string,int>Map; 16 int flag; 17 int ans; 18 string dfs(int len,int x,int y,int deep,int &temp) 19 { 20 string s="