当前位置:网站首页>Preliminary sequencing problem
Preliminary sequencing problem
2022-06-23 03:33:00 【Dark horse breeze】
Sorting is always on , All the time . In the algorithm, , Sort with count , Selection sort i, Bubble sort , Insertion sort , Quick sort and so on .
The following is a question using the sorting algorithm to illustrate the problem .
ELO Valley P1059 For example, the random number with a clear question .
#include<iosteam>
#include<algorithm>
using namespace std;
int const MAXN=1010;
int a[MAXN],ans[MAXN],n,cnt=0,tmp=-1;
int main(){
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
for(int i=0;i<n;i++)
{
if(a[i]!=tmp)ans[cnt++]=a[i];
tmp=a[i];
}
cout<<cnt<<endl;
for(int i=0;i<cnt;i++)cout<<ans[i]<<' ';
return 0;
}It's used here stl Algorithm .
边栏推荐
- Decentralized networks are not decentralized
- What is the reason why anonymous live OBS streaming is successful but flv video cannot be played?
- Why not use math random() ?!
- Best practices for building multi architecture mirrors
- Implementation process of the new electronic amplification function of easycvr video fusion cloud platform
- Analysis on the development of duty-free industry in Hainan Province in 2021: the implementation of the new policy makes the duty-free market in Hainan more "prosperous" [figure]
- CFs of cifs/smb protocol is mounted on win10/2019. Error 1272 is reported. The security policy prevents unauthenticated guest access
- Summary of some precautions and problems in the use of tars framework (mengxinxiang)
- What is the difference between JS undefined and null
- The cloud disk has been offline from the internal machine, but the console uninstall failed
猜你喜欢

Analysis on the development of duty-free industry in Hainan Province in 2021: the implementation of the new policy makes the duty-free market in Hainan more "prosperous" [figure]

Jmeter- (V) simulated user concurrent login for interface test
![Analysis on development history, industrial chain, output and enterprise layout of medical polypropylene in China in 2020 [figure]](/img/28/ebfc25ec288627706e15a07e6bdb77.jpg)
Analysis on development history, industrial chain, output and enterprise layout of medical polypropylene in China in 2020 [figure]

Analysis on the development of China's graphene industry chain in 2021: with the support of energy conservation and environmental protection policies, the scale of graphene industry will continue to e
![Analysis of China's integrated circuit industry chain in 2021: huge downstream market demand [figure]](/img/de/d73805aaf4345ca3d2a7baf85aab8d.jpg)
Analysis of China's integrated circuit industry chain in 2021: huge downstream market demand [figure]

【贪心】leetcode991. Broken Calculator
![[quick view] Analysis on the development status and future development trend of the global and Chinese diamond cultivation industry in 2021 [figure]](/img/f1/972a760459a6d599b5681aa634df09.jpg)
[quick view] Analysis on the development status and future development trend of the global and Chinese diamond cultivation industry in 2021 [figure]
![Analysis on the development prospect of China's brain computer interface industry in 2021: wide application prospect, sustained and rapid growth of market scale [figure]](/img/84/192d152ceb760264b6b555b321f129.jpg)
Analysis on the development prospect of China's brain computer interface industry in 2021: wide application prospect, sustained and rapid growth of market scale [figure]

Gakataka student end to bundle Version (made by likewendy)
![Analysis on the development status of China's watch industry in 2021: a large number of electric watches are imported [figure]](/img/ca/672bfe49c8123da8679b2abeb43a2e.jpg)
Analysis on the development status of China's watch industry in 2021: a large number of electric watches are imported [figure]
随机推荐
Flowable refactoring process editor to obtain user information
Methods for MySQL to avoid inserting duplicate records
Decentralized networks are not decentralized
The primary level of SAP retail uses the transaction code wrfmatcopy to create commodity master data
[metauniverse 7ai rope skipping] how is this app light application realized? What are the application scenarios?
Learning summary of spanquery source code
MySQL gets the top 1 and top n records after grouping
CFS After the CHM file is opened, the hyperlink content cannot be loaded and blank is displayed
What are the advantages and difficulties of introducing AI into ISP Technology
Engineer culture: should the company buy genuine software
How to install redis version 5.0.8 on the pagoda panel
SwiftUI 组件大全之使用 ScrollView 和 GeometryReader 创建动画 3D卡片 滚动效果
Tachometer script
The difference between code39 and code93
How to print multiple barcode labels on one sheet of paper
Enterprise official website applet building tutorial - solution
Encryption related to returnee of national market supervision public service platform
To implement a task scheduling system, it is enough to read this article
【贪心】leetcode991. Broken Calculator
How to make distribution box label