48592023-04-03 08:06:55EyusieBejgli (80 pont)cpp17Accepted 80/8032ms5568 KiB
#include <bits/stdc++.h>

using namespace std;
int n, temp;
int db = 0;
int legt = 0;
int legtind;
int main()
{
    cin >> n;
    vector<int> a(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/03ms1812 KiB
2Accepted0/03ms2052 KiB
3Accepted4/43ms2272 KiB
4Accepted4/43ms2504 KiB
5Accepted4/43ms2716 KiB
6Accepted4/43ms2916 KiB
7Accepted4/43ms3088 KiB
8Accepted4/43ms3200 KiB
9Accepted4/43ms3400 KiB
10Accepted4/43ms3644 KiB
11Accepted4/43ms3704 KiB
12Accepted4/43ms3836 KiB
13Accepted4/44ms3932 KiB
14Accepted4/44ms4196 KiB
15Accepted4/46ms4424 KiB
16Accepted4/46ms4768 KiB
17Accepted4/413ms4840 KiB
18Accepted4/419ms5288 KiB
19Accepted4/426ms5284 KiB
20Accepted4/427ms5472 KiB
21Accepted4/432ms5568 KiB
22Accepted4/421ms5452 KiB