DFS
老猪佩琪
这个作者很懒,什么都没留下…
展开
-
EOJ 3536. 蛇形矩阵
首先当然是找规律 当然厉害的大佬可以直接通过数学方法求解 我这种菜鸡只能打表找找规律 打表就是一个简单的dfs 用一个矩阵记录当前走过的格子 然后朝着一个方向走 要碰到已经走过的格子的时候就换各方向 走过n*n格的时候结束递归,代码如下: #include<iostream> #include<cstring> #include<iomanip> us...原创 2018-08-04 14:33:58 · 323 阅读 · 0 评论 -
2017 ACM QingDao The Squared Mosquito Coil
Lusrica designs a mosquito coil in a board with n × n grids. The mosquito coil is a series of consecutive grids, each two neighboring grids of which share a common border. If two grids in the mosquito...原创 2018-07-31 20:23:09 · 285 阅读 · 0 评论