题解 1165: 明明的随机数

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

明明的随机数- 排序+ 双指针

摘要:解题思路:排序 + 双指针注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; const int N = ……

简单又实用,看不懂请打死我

摘要:解题思路:用排序函数sort对输入的数据进行排序,使用降重函数unique对输入的数据进行降重并输出注意事项:使用sort和unique前添加头文件#include<algorithm>参考代码:#i……

1165: 明明的随机数

摘要:```cpp #include using namespace std; int main() { int a,s1[100],s2[100],s=0,x=1,j; cin……

用set去重并排序

摘要:解题思路:通过set关联容器,set中每个元素都唯一,且能根据元素的值自动排序。注意事项:参考代码:#include <bits/stdc++.h>  //万能头文件 using namespace ……

使用STL set容器进行解题

摘要:解题思路:先定义一个整型数组,从键盘赋值,然后再插入到set容器中,set 本身就可以达到去重,而且默认升序注意事项:参考代码:    #include<iostream>#include<set>i……

1165: 明明的随机数

摘要:解题思路:先用数组装,然后排好序后,装入set,然后输出就好了注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int main() ……