用sort函数解决问题 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;bool cmp(int a,int b){ return abs(a)>abs(b…… 题解列表 2022年07月19日 0 点赞 0 评论 551 浏览 评分:0.0
用全排列函数next_permutation()解决 问题 解题思路:用三个for循环来找出三个不同的数的组合123124134234在用next_permutation函数来输出注意事项:next_permutation不会输出原本的序列,所以用do-while来解决参考代码:#includeusingnamespacestd; 题解列表 2022年07月19日 0 点赞 0 评论 550 浏览 评分:0.0
SInzoL--题解 1264: 防御导弹 ####看到大多数的题解都是用数组记忆,再比较最大值来做的,我给大家提供一个不同的思路:dfs(超弱的)###粘代码:```cpp#includeusingnamespacestd;intl=1,gs=1;intdd[24];voiddeal(inta, 题解列表 2022年07月19日 0 点赞 0 评论 789 浏览 评分:9.9
字符串编码(C++) 摘要:解题思路:注意事项:参考代码:#include <iostream>using namespace std;int main(){ string str; cin >> str; int …… 题解列表 2022年07月18日 0 点赞 0 评论 683 浏览 评分:0.0
优质题解 2276: 蓝桥杯2018年第九届真题-全球变暖(bfs) 解题思路:做这道题看错了两个地方,一开始做成了求存活的#的数量,后来又看成了存活的岛屿的数量,其实题目问的是有多少岛屿被淹没。可以上下左右联通的为同一岛屿,以样例数据为例:有两岛屿,只有右下角的岛屿中有一个不和海洋接触的陆地#,所以左上角的岛屿会被淹没,右下角的岛屿会存留下来。 题解列表 2022年07月18日 0 点赞 0 评论 1424 浏览 评分:9.9
#C++1870——统计字符 摘要:#include <iostream> #include <cstring> #include <algorithm> using namespace std; int a[26],b[26]…… 题解列表 2022年07月18日 0 点赞 0 评论 720 浏览 评分:0.0
挺简单的一个题 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ int n, a,b; cin>>n;…… 题解列表 2022年07月17日 0 点赞 0 评论 543 浏览 评分:0.0
可以用下递归 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;long f(int n){ if(n==1||n==0) return 1; el…… 题解列表 2022年07月17日 0 点赞 0 评论 578 浏览 评分:7.0
其实就是一个人简单的循环 摘要:#include<bits/stdc++.h>using namespace std;int main(){ int n,a; cin>>n; for(int i=1;;i++) …… 题解列表 2022年07月17日 0 点赞 0 评论 512 浏览 评分:0.0
简单1002: [编程入门]三个数最大值 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>//万能头文件using namespace std;int main(){ int a,b,c; cin>>a>>b>>c…… 题解列表 2022年07月17日 0 点赞 0 评论 690 浏览 评分:0.0