48612023-04-03 08:20:37EyusieBejgli (80 pont)cpp17Accepted 80/8034ms4984 KiB
#include <bits/stdc++.h>

using namespace std;
int n, temp, legtind;
int db = 0;
int legt = 0;
vector<int> a;
int main()
{
    cin >> n;
    a.assign(n+1, 0);
    for(int i = 0; i < n; i++)
    {
        cin >> temp;
        a[temp]++;
    }

    for(int i = 1; i <= n; i++)
    {
        db+= a[i]/i;
        if(legt < a[i]/i)
        {
            legt = a[i]/i;
            legtind = i;
        }
    }
    cout << db << "\n" << legtind;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1872 KiB
2Accepted0/03ms2124 KiB
3Accepted4/43ms2372 KiB
4Accepted4/43ms2732 KiB
5Accepted4/42ms2856 KiB
6Accepted4/42ms2812 KiB
7Accepted4/43ms2964 KiB
8Accepted4/43ms3120 KiB
9Accepted4/43ms3336 KiB
10Accepted4/43ms3404 KiB
11Accepted4/43ms3540 KiB
12Accepted4/43ms3560 KiB
13Accepted4/44ms3700 KiB
14Accepted4/44ms3764 KiB
15Accepted4/46ms4036 KiB
16Accepted4/46ms3992 KiB
17Accepted4/413ms4356 KiB
18Accepted4/419ms4840 KiB
19Accepted4/426ms4984 KiB
20Accepted4/427ms4944 KiB
21Accepted4/434ms4940 KiB
22Accepted4/421ms4924 KiB