摘要: 思路: 5分代码 Tip: 无 #include <bits/stdc++.h> using namespace std; const int maxn = 100000 + 5; int main() { long long n, m; cin >> n >> m; if(n==1) cout < 阅读全文
posted @ 2021-04-27 10:22 Whiteying 阅读(637) 评论(0) 推荐(0) 编辑
摘要: 思路: dfs+回溯,不加回溯只有26分 Tip: 直接拿纸条往上怼 #include <bits/stdc++.h>using namespace std;const int maxn = 100000 + 5;struct mmp { int i; int at; vector<int> v;} 阅读全文
posted @ 2021-04-27 10:21 Whiteying 阅读(403) 评论(0) 推荐(0) 编辑
摘要: 思路: 模拟 Tip: L2中最简单的一道题了,题目虽长但是代码不长也很好理解 #include <bits/stdc++.h> using namespace std; const int maxn = 100000 + 5; vector<int> v[maxn]; int cun[maxn]; 阅读全文
posted @ 2021-04-27 10:19 Whiteying 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 思路: stl数据结构应用 Tip: 没啥好说的,做法千变万化,看自己的数据结构功底 #include <bits/stdc++.h> using namespace std; const int maxn = 10000 + 5; int n, m; struct mmp { int a[105] 阅读全文
posted @ 2021-04-27 10:18 Whiteying 阅读(425) 评论(0) 推荐(0) 编辑
摘要: 思路: dfs+优化 Tip: 得到答案后回溯可得到路径 #include <bits/stdc++.h> using namespace std; const int maxn = 10000 + 5; int father[maxn]; bool isp[maxn]; int ceng[maxn 阅读全文
posted @ 2021-04-27 10:17 Whiteying 阅读(507) 评论(0) 推荐(0) 编辑
摘要: 思路: 栈和队列,轨道为队列筐为栈,按下筐按钮从筐中拿一个物品;按下轨道按钮,从轨道拿一个物品放到筐。若筐已满,则先从筐中拿一个物品;若轨道或筐为空,则按对应按钮不会发生任何事。 Tip: 注意语言顺序即可 #include <bits/stdc++.h> using namespace std; 阅读全文
posted @ 2021-04-27 10:14 Whiteying 阅读(331) 评论(0) 推荐(0) 编辑
摘要: 思路: 简单递推 Tip: 注意结果为0的情况 #include <bits/stdc++.h> using namespace std; const int maxn = 1000 + 5; int ans[maxn]; int main() { int a, b, n; cin >> a >> 阅读全文
posted @ 2021-04-27 10:13 Whiteying 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 思路: 水题,略过 Tip: 无 #include <bits/stdc++.h> using namespace std; int main() { int maxx = -1, minn = 0x3f3f3f3f; int cntmax = 0, cntmin = 0; int n; cin > 阅读全文
posted @ 2021-04-27 10:12 Whiteying 阅读(472) 评论(0) 推荐(0) 编辑
摘要: 思路: 字符串处理 Tip: getline和find的应用 #include <bits/stdc++.h> using namespace std; int main() { int n, t, num = 0; string now; cin >> n >> t; getchar(); for 阅读全文
posted @ 2021-04-27 10:11 Whiteying 阅读(637) 评论(0) 推荐(0) 编辑
摘要: 思路: 水题,略过 Tip: 无 #include <bits/stdc++.h> using namespace std; int a[1000]; int main() { for (int i = 0; i < 24; i++) cin >> a[i]; int n; while (cin > 阅读全文
posted @ 2021-04-27 10:10 Whiteying 阅读(301) 评论(0) 推荐(0) 编辑