78672024-01-11 14:16:30AblablablaKert (75 pont)cpp17Partially correct 71/75303ms4316 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]);
        }

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

    cout << valasz << "\n" << maxi << "\n";
}
SubtaskSumTestVerdictTimeMemory
base71/75
1Accepted0/03ms1816 KiB
2Accepted0/0286ms2172 KiB
3Partially correct2/43ms2220 KiB
4Accepted4/43ms2332 KiB
5Partially correct2/43ms2452 KiB
6Accepted4/43ms2828 KiB
7Accepted4/43ms2904 KiB
8Accepted4/43ms2960 KiB
9Accepted4/43ms3184 KiB
10Accepted4/48ms3380 KiB
11Accepted6/64ms3332 KiB
12Accepted6/614ms3576 KiB
13Accepted6/637ms3516 KiB
14Accepted6/6270ms3776 KiB
15Accepted6/6254ms4076 KiB
16Accepted6/6303ms3904 KiB
17Accepted7/7170ms4316 KiB