熟练使用STL容器,尽量多使用STL容器 摘要:解题思路: - 用vector容器将所有老年人(age>=60)筛出,然后排序,排序的话要使用stable_sort,它会在排序过程保持相等元素的原来的顺序 - 用vector存老年人要在里套一个…… 题解列表 2024年11月03日 0 点赞 0 评论 261 浏览 评分:0.0
母牛的故事_推导表达式 摘要:解题思路:采用递归的做法,我么需要考虑每一年母牛的数量和前面几年之间的关系,写出递推公式,就能轻松写出代码。我们以f(n)表示第n年母牛的数量。第一年:f(1)=1,只有一只母牛。第二年:f(2)=f…… 题解列表 2024年11月03日 4 点赞 0 评论 542 浏览 评分:10.0
明明的随机数 摘要:```cpp include include include include using namespace std; const int N = 110; int n; in…… 题解列表 2024年11月03日 1 点赞 0 评论 343 浏览 评分:9.9
没有上司的晚会 树形dp 摘要: #include using namespace std; int h[6005], v[6005], f[6005][2], n, x, y, root; /*h数组…… 题解列表 2024年11月02日 0 点赞 0 评论 257 浏览 评分:9.9
3005: 糖果游戏题解 摘要:解题思路:可以把这个问题看作是一个循环分配的过程,由于是圆桌,1号和5号小朋友也是相邻的。可以利用数组来模拟每个小朋友手中的糖果数量,通过计算每个小朋友分配后的糖果情况,更新数组中的值。通过模运算对索…… 题解列表 2024年11月01日 0 点赞 0 评论 280 浏览 评分:0.0
2757: 浮点数向零舍入题解 摘要:解题思路:注意事项:参考代码:#include <iostream> #include <cmath> using namespace std; double round(double r) …… 题解列表 2024年11月01日 0 点赞 0 评论 269 浏览 评分:0.0
包会,不会你来锤我 摘要:#### 贪心策略:优先选择先结束的活动,保证每个选择子结构的最佳结果 ```cpp #include #include using namespace std; //创建结构体,结构体…… 题解列表 2024年10月31日 2 点赞 3 评论 532 浏览 评分:10.0
与7无关的数 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <cmath>using namespace std;int main(){ int n; cin >…… 题解列表 2024年10月31日 0 点赞 0 评论 212 浏览 评分:7.3
最易懂的代码 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int n,r;int arr[30];void func(int x,int st…… 题解列表 2024年10月31日 0 点赞 0 评论 403 浏览 评分:6.0
杀到这九天十地无人敢称尊,直到身边再无一人能陪我征战,叶天帝不过如此 摘要:# 不用抽象标题没人看俺题解 此题模板题就不多说了 直接看看代码 ###### AC Code: ```cpp #include #include #include #includ…… 题解列表 2024年10月30日 1 点赞 1 评论 283 浏览 评分:10.0