1 solutions

  • 0
    @ 2024-4-8 12:15:21

    #include<bits/stdc++.h> using namespace std; int main() { map <int,int> a; //把它看成数组 set b; int n,i,q; cin>>n; for(i=1; i<=n; i++) { scanf("%d",&q); a[q]++; b.insert(q); } for(set::iterator it=b.begin(); it!=b.end(); it++) //迭代器 printf("%d %d\n",*it,a[*it]); }

    • 1

    Information

    ID
    97
    Time
    1000ms
    Memory
    125MiB
    Difficulty
    2
    Tags
    # Submissions
    110
    Accepted
    37
    Uploaded By