48562023-04-03 07:56:09EyusieBejgli (80 pont)cpp17Wrong answer 76/8032ms4908 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> a(n, 0);
    int temp;
    for(int i = 0; i < n; i++)
    {
        cin >> temp;
        a[temp]++;
    }
    int db = 0;
    int legt = 0;
    int legtind;
    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
base76/80
1Accepted0/03ms1812 KiB
2Accepted0/03ms2060 KiB
3Accepted4/42ms2268 KiB
4Accepted4/42ms2324 KiB
5Accepted4/43ms2548 KiB
6Wrong answer0/43ms2744 KiB
7Accepted4/43ms2824 KiB
8Accepted4/43ms2952 KiB
9Accepted4/43ms3164 KiB
10Accepted4/43ms3376 KiB
11Accepted4/43ms3464 KiB
12Accepted4/43ms3468 KiB
13Accepted4/44ms3608 KiB
14Accepted4/44ms3980 KiB
15Accepted4/46ms3936 KiB
16Accepted4/46ms3752 KiB
17Accepted4/413ms4168 KiB
18Accepted4/419ms4592 KiB
19Accepted4/426ms4816 KiB
20Accepted4/427ms4804 KiB
21Accepted4/432ms4908 KiB
22Accepted4/421ms4808 KiB