随笔分类 -  kuangbin专题 / 专题一 简单搜索

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 阅读(49) 评论(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 阅读(55) 评论(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 阅读(24) 评论(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 阅读(21) 评论(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 阅读(33) 评论(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 阅读(27) 评论(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 阅读(39) 评论(0) 推荐(0)

6.质数路径
摘要:原题:https://www.acwing.com/problem/content/description/4223/ #include<iostream> #include<cstring> #include<queue> using namespace std; const int N=1001 阅读全文

posted @ 2023-03-22 22:02 skaman 阅读(30) 评论(0) 推荐(0)

5.找倍数
摘要:https://www.acwing.com/problem/content/description/4222/ **ab%n=((a%n)b)%n // a*b%n=((a%n)*b)%n #include<iostream> #include<queue> using namespace std 阅读全文

posted @ 2023-03-22 21:59 skaman 阅读(17) 评论(0) 推荐(0)

4. 翻转
摘要:https://www.acwing.com/problem/content/solution/4221/1/ 解法一:枚举第一行状态,递推 #include<iostream> #include<cstring> using namespace std; const int N=20; int n 阅读全文

posted @ 2023-03-15 16:51 skaman 阅读(39) 评论(0) 推荐(0)

3. 抓住那头牛
摘要:https://www.acwing.com/problem/content/1102/ #include<iostream> #include<cstring> using namespace std; const int N=200010; int n,m; int dist[N]; int q 阅读全文

posted @ 2023-03-14 22:02 skaman 阅读(20) 评论(0) 推荐(0)

2. 地牢大师
摘要:原题:棋盘问题。 #include<iostream> #include<cstring> #include<queue> using namespace std; const int N=110; char g[N][N][N]; int dist[N][N][N]; int n,m,d; str 阅读全文

posted @ 2023-03-14 21:59 skaman 阅读(28) 评论(0) 推荐(0)

1. 棋盘问题
摘要:##棋盘问题 原题:棋盘问题。 在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。 ###输入格式 输入含有多组测试数据。 每组数据的第一行是两个正整 阅读全文

posted @ 2023-02-24 15:40 skaman 阅读(40) 评论(0) 推荐(0)