摘要:
思路分析:本题可以采取BFS的方式进行解题,我们把每一个节点的下一层节点全部遍历完,并让它们不再次遍历(设置标志数组)。bfs的解决方法是利用队列知识,每次读取一个数据,并让该数据出队,然后把该节点的子节点依次入队,直到最后遍历完毕。下面贴上代码: 1 #include 2 #include 3 #... 阅读全文
摘要:
Gnome TetravexTime Limit:10 Seconds Memory Limit:32768 KBHart is engaged in playing an interesting game, Gnome Tetravex, these days. In the game, at t... 阅读全文
摘要:
The StaircasesTime Limit: 1.0 secondMemory Limit: 16 MBOne curious child has a set ofNlittle bricks (5 ≤N≤ 500). From these bricks he builds different... 阅读全文