1 solutions

  • 0
    @ 2022-3-2 16:40:56
    #include<iostream>
    #include<cstdio>
    #include<cmath>
    #include<cstdlib>
    #include<cstring>
    #include<algorithm>
    #include<vector>
    #include<string>
    #include<map>
    #include<stack>
    
    using namespace std;
    map<int, int>mp;
    
    int main() {
    	int n, x;
    	cin >> n;
    	for (int i = 0; i < n; i++) {
    		cin >> x;
    		mp[x]++;
    	}
    	for (auto it = mp.begin(); it != mp.end(); it++) {
    		cout << it->first << " " << it->second << endl;
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    1100
    Time
    1000ms
    Memory
    16MiB
    Difficulty
    3
    Tags
    # Submissions
    25
    Accepted
    18
    Uploaded By