5 条题解

  • 1
    @ 2022-3-20 20:51:58
    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <iostream>
    using namespace std;
    int a [1000];
    int main()
    {
    	int n ;
    	cin >> n;
    	int maxx = 0;
    	for(int i = 0,x ;i < n ;i++)
    	{
    		cin >> x;
    		a[x]++;
    		maxx = max(maxx , a[x]);
    	}
    	for(int i = 1 ; i <= 100 ; i++)
    	{
    		if(a[i] == maxx)
    		{
    			cout << i << " " << a[i] << endl;
    		}
    	}
    }
    

    信息

    ID
    998
    时间
    1000ms
    内存
    128MiB
    难度
    4
    标签
    递交数
    356
    已通过
    174
    上传者