1 solutions

  • 1
    @ 2024-9-25 20:19:27
    #include<bits/stdc++.h>
    using namespace std;
    map<int, int> h;
    int main()
    {
    	int n;
    	cin>>n;
    	for(int i=0;i<n;i++) 
        {
    		int a;
    		cin>>a;
    		h[a]++;
    	}
    	for(auto x:h)
        {
    		cout<<x.first<<" "<<x.second<<endl;
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    157
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    15
    Accepted
    9
    Uploaded By