48642023-04-03 08:34:34EyusieBejgli (80 pont)cpp17Accepted 80/8012ms4720 KiB
#include <bits/stdc++.h>

using namespace std;
int n, temp, legtind;
int db = 0;
int legt = 0;
vector<int> a;
int main()
{
    iostream::sync_with_stdio(0);
    cin.tie(0);
    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/03ms1892 KiB
2Accepted0/03ms2116 KiB
3Accepted4/43ms2604 KiB
4Accepted4/43ms2460 KiB
5Accepted4/43ms2672 KiB
6Accepted4/43ms2888 KiB
7Accepted4/42ms2972 KiB
8Accepted4/43ms3092 KiB
9Accepted4/43ms3184 KiB
10Accepted4/43ms3436 KiB
11Accepted4/43ms3472 KiB
12Accepted4/43ms3688 KiB
13Accepted4/43ms3676 KiB
14Accepted4/43ms3688 KiB
15Accepted4/44ms3696 KiB
16Accepted4/44ms3892 KiB
17Accepted4/47ms3868 KiB
18Accepted4/49ms4392 KiB
19Accepted4/410ms4392 KiB
20Accepted4/412ms4648 KiB
21Accepted4/412ms4720 KiB
22Accepted4/410ms4668 KiB