70942023-12-30 11:21:29MagyarKendeSZLGKert (75 pont)cpp17Accepted 75/7586ms21700 KiB
#include <bits/stdc++.h>

#define speed cin.tie(0); ios::sync_with_stdio(0)

using namespace std;

int main() {
    speed;

    int M, N, P, p1 = 0, p2 = 1;
    cin >> M >> N >> P;
    vector<int> v(N);
    while (M--) {
        unordered_map<int, int> m;
        for (int i = 0; i < N; i++) {
            cin >> v[i];
            m[v[i]]++;
        }
        for (auto [_, db] : m) {
            if (N - db < db) {
                p1++;
                break;
            }
        }
        int l = 0, r = 0;
        while (r < N - 1) {
            if (v[r + 1] != v[r]) {
                l = r + 1;
                r = l;
            } else {
                r++;
                p2 = max(p2, r - l + 1);
            }
        }
    } 

    cout << p1 << '\n' << p2;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1828 KiB
2Accepted0/082ms6236 KiB
3Accepted4/43ms6028 KiB
4Accepted4/43ms6036 KiB
5Accepted4/43ms6184 KiB
6Accepted4/43ms6280 KiB
7Accepted4/43ms6500 KiB
8Accepted4/43ms6736 KiB
9Accepted4/43ms6964 KiB
10Accepted4/44ms7128 KiB
11Accepted6/63ms6920 KiB
12Accepted6/67ms7084 KiB
13Accepted6/617ms7936 KiB
14Accepted6/683ms11340 KiB
15Accepted6/671ms15276 KiB
16Accepted6/686ms19268 KiB
17Accepted7/764ms21700 KiB