随笔分类 - 搜索
摘要:OpenJ_Bailian - 1088 题解:DFS记忆化搜索 记忆化搜索也可以说是动态规划,最后的答案也是从一个个子问题推导而来 #include <bits/stdc++.h> #define Zeoy std::ios::sync_with_stdio(false), std::cin.ti
阅读全文
摘要:Gym - 103427J Luggage Lock 题解:BFS预处理+偏移 首先我们考虑暴力做法,对于每次查询我们都去找出$a_0a_1a_2a_3$到$b_0b_1b_2b_3$的最小步骤,如果给你0000->9999,我们需要遍历1e4中状态,所以1e5次查询,显然数量级为1e9>1e8 所
阅读全文
摘要:POJ - 1321 棋盘问题 题解:DFS搜索 #include <bits/stdc++.h> #define Zeoy std::ios::sync_with_stdio(false), std::cin.tie(0), std::cout.tie(0) #define all(x) (x).
阅读全文