1 solutions

  • 0
    @ 2025-10-12 11:56:59
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n;
    	cin>>n;
    	map<int,int> h;
    	for(int i=1;i<=n;i++){
    		int x;
    		cin>>x;
    		h[x]++;
    	}
    	stack<int> tk;
    	for(auto i:h){
    		tk.push(i.second);
    	}
    	int q=0;
    	for(auto i:h){
    		cout<<tk.top()<<endl;
    		tk.pop();
    		q++;
    	}
    	for(int i=1;i<=n-q;i++){
    		cout<<0<<endl;
    	}
    	return 0;
    }
    
    • 1

    [ABC273C] 第 K+1 大的数((K+1)-th Largest Number)

    Information

    ID
    2623
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    3
    Tags
    # Submissions
    3
    Accepted
    3
    Uploaded By