1 条题解

  • 0
    @ 2026-10-25 15:22:53

    思路

    全int域与十万输入、五百不同值,严格有序去重输出。

    参考程序(C++11)

    #include <bits/stdc++.h>
    using namespace std;
    int main(){int n,x;cin>>n;set<int>a;while(n--){cin>>x;a.insert(x);}bool first=true;for(int x:a){if(!first)cout<<' ';first=false;cout<<x;}cout<<'\n';}
    
    • 1

    信息

    ID
    1144
    时间
    1000ms
    内存
    64MiB
    难度
    进阶
    标签
    递交数
    1
    已通过
    1
    上传者