04 2023 档案

8.旅行
摘要:原题:https://www.acwing.com/problem/content/description/4237/ #pragma GCC optimize(2) #include<iostream> #include<cstring> using namespace std; const in 阅读全文

posted @ 2023-04-10 09:31 skaman 阅读(17) 评论(0) 推荐(0)

7.A计划
摘要:原题:https://www.acwing.com/problem/content/solution/4236/1/ #include<iostream> #include<cstring> #include<queue> using namespace std; const int N=15,IN 阅读全文

posted @ 2023-04-09 22:11 skaman 阅读(46) 评论(0) 推荐(0)

6.噩梦
摘要:原题:https://www.acwing.com/problem/content/description/179/ #include<iostream> #include<cstring> #include<queue> using namespace std; #define x first # 阅读全文

posted @ 2023-04-09 20:52 skaman 阅读(34) 评论(0) 推荐(0)

5.DNA序列
摘要:原题:https://www.acwing.com/problem/content/submission/code_detail/24508041/ 思路:IDA*根据每个字母开搜,也就是由“AGCT”开搜,记录每一个要枚举的字符串的枚举到的下标pos数组,启发函数使用最长的还未匹配的字符串的剩余字 阅读全文

posted @ 2023-04-07 15:33 skaman 阅读(171) 评论(0) 推荐(0)

4.逃跑
摘要:原题:https://www.acwing.com/problem/content/submission/code_detail/24498789/ 注意可以原地不走,因此要用visited数组判重,队列中也不能仅仅只存坐标。 #pragma GCC optimize (2) #include<io 阅读全文

posted @ 2023-04-07 13:56 skaman 阅读(43) 评论(0) 推荐(0)

3.哈密顿绕行世界问题
摘要:原题链接:https://www.acwing.com/problem/content/description/4232/ 思路很像全排列,运用压缩状态存储,注意细节 #include<iostream> #include<cstring> #include<algorithm> using nam 阅读全文

posted @ 2023-04-06 22:30 skaman 阅读(33) 评论(0) 推荐(0)

2.八数码二(IDA*)
摘要:原题链接:https://www.acwing.com/problem/content/4231/ //IDA* #include<iostream> #include<cstring> #include<algorithm> #include<unordered_map> #include<que 阅读全文

posted @ 2023-04-06 17:07 skaman 阅读(22) 评论(0) 推荐(0)

1.八数码
摘要:原题链接:https://www.acwing.com/problem/content/description/181/ A*的重点在于利用优先队列记录到达当前节点的真实距离加上从当前节点出发到终点的估计距离,用该信息作为第一关键字来处理各个状态。 在四个方向处理时要注意恢复状态。 #include 阅读全文

posted @ 2023-04-06 14:42 skaman 阅读(26) 评论(0) 推荐(0)

13.非常可乐
摘要:原题链接:https://www.acwing.com/solution/content/90865/ #include<iostream> #include<queue> #include<cstring> using namespace std; const int N=105,INF=0x3f 阅读全文

posted @ 2023-04-04 21:45 skaman 阅读(48) 评论(0) 推荐(0)

14.找路
摘要:原题链接:https://www.acwing.com/problem/content/description/4230/ #include<iostream> #include<cstring> #include<queue> using namespace std; #define x firs 阅读全文

posted @ 2023-04-04 09:11 skaman 阅读(47) 评论(0) 推荐(0)

12.石油储备
摘要:原题链接:https://www.acwing.com/problem/content/description/4228/ //简单Flood Fill #include<iostream> #include<cstring> #include<queue> using namespace std; 阅读全文

posted @ 2023-04-03 21:54 skaman 阅读(12) 评论(0) 推荐(0)

11.迷宫问题
摘要:原题链接:https://www.acwing.com/problem/content/description/1078/ #include<iostream> #include<cstring> #include<vector> using namespace std; #define x fir 阅读全文

posted @ 2023-04-03 21:34 skaman 阅读(19) 评论(0) 推荐(0)

10.起火迷宫
摘要:原题链接:acwing.com/problem/content/submission/4227/ #include<iostream> #include<cstring> #include<queue> using namespace std; typedef pair<int,int> PII; 阅读全文

posted @ 2023-04-02 20:28 skaman 阅读(20) 评论(0) 推荐(0)

9.点火游戏
摘要:原题链接:https://www.acwing.com/problem/content/description/4226/ #include<iostream> #include<cstring> #include<queue> using namespace std; const int N=15 阅读全文

posted @ 2023-04-02 17:18 skaman 阅读(25) 评论(0) 推荐(0)

8.罐子
摘要:原题链接:https://www.acwing.com/problem/content/description/4225/ #include<bits/stdc++.h> using namespace std; struct Operator{ int x,y; }; int a,b,c; int 阅读全文

posted @ 2023-04-02 16:42 skaman 阅读(21) 评论(0) 推荐(0)

7. 洗牌
摘要:原题链接:https://www.acwing.com/problem/content/description/4224/ #include<bits/stdc++.h> using namespace std; string a,b,c; unordered_map<string,int> dis 阅读全文

posted @ 2023-04-02 12:56 skaman 阅读(32) 评论(0) 推荐(0)