摘要:
思路:题目要求输出每一次走的点,所以我的想法是给每个结点再加个id和fro代表他现在是第几个遍历的和他的根节点是谁,接下来就是常规的bfs了,把答案压到栈里面,最后输出。#include#include#include#include#include#include#... 阅读全文
摘要:
A:dfs水题https://blog.csdn.net/Dilly__dally/article/details/81490710B:三维bfs水题https://blog.csdn.net/Dilly__dally/article/details/81517553... 阅读全文
摘要:
思路:用队列存储“打的表”,即从1开始,1的10倍满足条件,1的10倍+1也满足条件,判断队头是否%n==0就行。#include#include#include#include#include#include#include#include#include#incl... 阅读全文
摘要:
虽然是水题,但要注意数组的越界和vis的使用,不然就RE、TLE#include#include#include#include#include#include#include#include#include#include#include#include#inclu... 阅读全文