78682024-01-11 14:17:51AblablablaKert (75 pont)cpp17Accepted 75/75277ms4084 KiB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int m, n, p;
    cin >> m >> n >> p;

    int maxi = 0;
    int valasz = 0;

    for(int i = 0; i < m; i++){
        map<int, int> db;
        int legN = 0;
        int most = 1;
        int a;
        cin >> a;
        db[a]++;
        int elozo = a;
        int elso = 1;

        for(int i = 1; i < n; i++){
            int akt;
            cin >> akt;

            if(akt == elozo){
                most++;
            } else{
                legN = max(legN, most);
                most = 1;
            }
            elozo = akt;

            db[akt]++;
            elso = max(elso, db[akt]);
        }

        legN = max(legN, most);

        maxi = max(maxi, legN);
        valasz += (elso > n - elso);
    }

    cout << valasz << "\n" << maxi << "\n";
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1808 KiB
2Accepted0/0263ms2256 KiB
3Accepted4/43ms2064 KiB
4Accepted4/43ms2420 KiB
5Accepted4/43ms2552 KiB
6Accepted4/43ms2628 KiB
7Accepted4/43ms2876 KiB
8Accepted4/43ms2964 KiB
9Accepted4/43ms3180 KiB
10Accepted4/48ms3012 KiB
11Accepted6/64ms3120 KiB
12Accepted6/613ms3260 KiB
13Accepted6/635ms3312 KiB
14Accepted6/6254ms3512 KiB
15Accepted6/6239ms3856 KiB
16Accepted6/6277ms3864 KiB
17Accepted7/7158ms4084 KiB