78652024-01-11 14:08:11AblablablaKert (75 pont)cpp17Partially correct 58/75275ms4316 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 = 0;
        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 = 0;
            }

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

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

    cout << valasz << "\n" << maxi << "\n";
}
SubtaskSumTestVerdictTimeMemory
base58/75
1Accepted0/03ms1944 KiB
2Accepted0/0259ms2232 KiB
3Partially correct2/43ms2160 KiB
4Partially correct2/43ms2380 KiB
5Partially correct2/43ms2452 KiB
6Accepted4/43ms2696 KiB
7Partially correct2/43ms2788 KiB
8Partially correct2/43ms3004 KiB
9Partially correct2/43ms3216 KiB
10Partially correct2/48ms3452 KiB
11Accepted6/63ms3516 KiB
12Accepted6/613ms3668 KiB
13Accepted6/635ms4084 KiB
14Partially correct3/6252ms3968 KiB
15Accepted6/6237ms4036 KiB
16Accepted6/6275ms4192 KiB
17Accepted7/7158ms4316 KiB