2603,利用set容器的特性快速解决 摘要:解题思路:SET容器在插入时会自动排序,重复的内容只存储一个,容器中不允许插入重复的值。size 返回容器中个数insert 插入元素erase 删除元素clear 清空容器中的元素find…… 题解列表 2022年08月31日 0 点赞 0 评论 764 浏览 评分:6.0
李白打酒加强版动态规划 分析:这是一道动态规划题,设f[i][j][k]表示走到了第i个位置,遇到了j个花,还剩k斗酒的合法方案数.初始化很简单就是f[0][0][2]=1,因为一开始酒的数量是2假如共遇到店n次,遇到花m次:那么答案就是f[n+m-1][m-1][1],这是很容易理解的, 题解列表 2022年08月31日 0 点赞 5 评论 1086 浏览 评分:9.6
reverse函数解 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>#include<algorithm>using namespace std;int main(){ …… 题解列表 2022年08月31日 0 点赞 0 评论 646 浏览 评分:0.0
1098: 陶陶摘苹果 摘要:```cpp #include using namespace std; int main() { int a[10],n,sum=0; for(int i=0;i>a[i…… 题解列表 2022年08月31日 0 点赞 0 评论 658 浏览 评分:9.9
1097: 蛇行矩阵 ```cpp#includeusingnamespacestd;intmain(){intx,cnt=1,mat[100][100];for(intj=0;jx)for(intj=0;j 题解列表 2022年08月31日 0 点赞 0 评论 517 浏览 评分:9.9
1096: Minesweeper ```cpp#include#includeusingnamespacestd;constintmaxn=101;intn,m,x[maxn],y[maxn],vist[maxn][maxn];charmap[maxn][maxn];voidcheck(intdx, 题解列表 2022年08月31日 0 点赞 0 评论 660 浏览 评分:9.9
1095: The 3n + 1 problem 摘要:```cpp #include using namespace std; int main() { int m,n,max; while(cin>>m>>n) {…… 题解列表 2022年08月31日 0 点赞 0 评论 695 浏览 评分:9.9
1094: 字符串的输入输出处理 摘要:```cpp #include using namespace std; int main() { int n; cin>>n; getchar(); …… 题解列表 2022年08月31日 0 点赞 0 评论 797 浏览 评分:9.9
题解 1154: C语言训练-邮票组合问题(C) 摘要:参考代码:#include<stdio.h> int main(void){ int i,j,sum,sum1=0; int n=0; for(i=0;i<5;i++){ fo…… 题解列表 2022年08月31日 0 点赞 0 评论 640 浏览 评分:0.0
优质题解 题解1153: C语言训练-谁家孩子跑最慢*(C-两种解法) #C语言:谁家孩子跑最慢##题目:张、王、李三家各有三个小孩。一天,三家的九个孩子在一起比赛短跑。规定不分年龄大小,跑第一得9分,跑第2得8分,依此类推。比赛结果:·各家的总分相同;·且这些孩子没有同时到达终点的;·也没有一家的两个或三个孩子获得相连的名次。 题解列表 2022年08月31日 1 点赞 0 评论 2149 浏览 评分:8.7