摘要:
题目传送门 C++代码 #include<bits/stdc++.h> using namespace std; const int N = 10; string ar[N]; //由啥 string br[N]; //变成啥 int n; //规则个数 string a, b; //原串,目标串 阅读全文
posted @ 2021-07-28 14:26
糖豆爸爸
阅读(70)
评论(0)
推荐(0)
摘要:
题目传送门 理解与感悟 1、从边缘出发进行思考。 2、把外围所有0涂色干掉,再剩下的0就是被包裹住的0,这些0需要修改为2. 3、所以OI的竞赛题,几乎没有祼的模板题,都是需要一点点思维难度的。这需要进行训练,刷题,没有别的办法。 #include <bits/stdc++.h> using nam 阅读全文
posted @ 2021-07-28 13:49
糖豆爸爸
阅读(95)
评论(0)
推荐(0)
摘要:
题目传送门 一、广度优先搜索解法 #include <bits/stdc++.h> using namespace std; const int N = 110; char a[N][N]; //地图 //坐标结构体 struct coord { int x, y; }; int n, m; int 阅读全文
posted @ 2021-07-28 11:45
糖豆爸爸
阅读(99)
评论(0)
推荐(0)
摘要:
题目传送门 #include <bits/stdc++.h> using namespace std; //哪个数字 int n; //全局路径(需要回溯) vector<int> path; //输出 void print() { //划分成两部分,最后一部分不在尾巴上加+号! for (int 阅读全文
posted @ 2021-07-28 11:28
糖豆爸爸
阅读(218)
评论(0)
推荐(0)
摘要:
题目传送门 理解与感悟 1、方向数组的使用 2、路径数组的使用 假如没有路径数组,就不好记录行走的过程,最终走到了终点,也不需要哪些点走过,没法重头描述路径。 带路径的dfs #include <bits/stdc++.h> using namespace std; const int N = 11 阅读全文
posted @ 2021-07-28 10:56
糖豆爸爸
阅读(68)
评论(0)
推荐(0)
摘要:
题目传送门 C++代码 #include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f; const int N = 30; string a[N * 2]; int res; //最大长度 char start; / 阅读全文
posted @ 2021-07-28 09:58
糖豆爸爸
阅读(87)
评论(0)
推荐(0)

浙公网安备 33010602011771号