明明的随机数(set容器自动排序和去重) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){&…… 题解列表 2025年05月01日 1 点赞 0 评论 172 浏览 评分:10.0
1102: 明明的随机数 摘要:解题思路:注意事项:参考代码:#include <bits/stdc++.h>using namespace std;set<int>st;int main(){ int n,m; cin…… 题解列表 2024年11月08日 0 点赞 0 评论 354 浏览 评分:10.0
优质题解 1102: 明明的随机数 摘要:解题思路:去重:数组的去重是很难直接把重复值“删去”的,此题要求输入的随机数都是正整数,所以可以把重复值全改成0,最后输出非0数,就算去重了。先排序,后去重。排序使用快速排序。注意事项:快速排序函数中…… 题解列表 2022年03月13日 1 点赞 0 评论 1073 浏览 评分:10.0
明明的随机数-题解(C++代码)-----新手级别 摘要:#include #include using namespace std; int main() { int n; cin>>n; int a[n]; for(int i=0…… 题解列表 2019年10月23日 0 点赞 0 评论 874 浏览 评分:9.9
明明的随机数(真的是随机数,求大佬指出错误!) 摘要:解题思路:注意事项:参考代码:#include <iostream>#include<ctime>#include<cstdlib>using namespace std;int main(){ i…… 题解列表 2023年06月21日 0 点赞 0 评论 147 浏览 评分:9.9
明明的随机数(正规) 摘要:解题思路:把相等于0,然后在排,在定义个数组,把不等于0的复制其中,然后输出.......注意事项:无参考代码:#include<iostream>#include<algorithm>using n…… 题解列表 2023年06月28日 0 点赞 0 评论 169 浏览 评分:9.9
1102: 明明的随机数 摘要:```cpp #include #include using namespace std; int main() { int N,i,j=0,b[100]; cin>>N…… 题解列表 2022年09月04日 0 点赞 0 评论 257 浏览 评分:9.9
1102: 明明的随机数(set) 摘要:解题思路:set集合自带默认升序和去重功能。参考代码:#include <bits/stdc++.h> #define ll long long using namespace std; …… 题解列表 2022年07月07日 0 点赞 1 评论 195 浏览 评分:9.9
1102: 明明的随机数 摘要:解题思路:去重:数组的去重是很难直接把重复值“删去”的,此题要求输入的随机数都是正整数,所以可以把重复值全改成0,最后输出非0数,就算去重了。先排序,后去重。排序使用快速排序。注意事项:快速排序函数中…… 题解列表 2022年05月20日 0 点赞 0 评论 244 浏览 评分:9.9
明明的随机数 题解 摘要:解题思路:这题题目要求给出n个数,把全部数输入,进行“去重”并“排序”的操作,最后输出操作完后的数列。那么这题我用了set轻松水过......STL中的set(也称集合),在输入时会自动排序并会去掉重…… 题解列表 2022年04月28日 0 点赞 6 评论 168 浏览 评分:9.9