分析:
在集合中存储的数据会自动去重,并默认按从小到大排序,所以本题只需要将所有编号插入set容器,然后输出即可
代码如下:
#include<bits/stdc++.h>
using namespace std;
int main(){
int n; cin >> n;
string s; int id;
set<int> st;
for(int i=0;i<n;i++){
cin >> s >> id;
st.insert(id);
}
for(auto i : st)
cout << i << endl;
return 0;
}