30672023-02-12 19:44:57xxxKert (75 pont)cpp14Accepted 75/75239ms13156 KiB
#include <bits/stdc++.h>
#include <vector>
using namespace std;

#define int long long
#define fr(n) for(int i =0; i<n; i++)
#define frj(n) for(int j =0; j<n; j++)

signed main() {
    int m, n, p, x;
    cin >> m >> n >> p;
    vector<vector<int>> a;
    a.resize(m, vector<int>(n));
    int temp = 0, cnt = 0, max = 0, ans = 0;
    fr(m) {
        cnt = 0;
        temp = 0;
        frj(n) {
            cin >> a[i][j];
            if (a[i][j] == temp)
                cnt++;
            else {
                temp = a[i][j];
                cnt = 1;
            }
            if (cnt > max) {
            max = cnt;
        }
        }

    }

    int ans2 = 0;
    for (int i = 0; i < m; i++) {
        sort(a[i].begin(), a[i].end());
        bool b = false;
        temp = 0;
        cnt = 0;
        for (int j = 0; j < n; j++) {
            if (a[i][j] == temp) {
                cnt++;
            }
            else {
                temp = a[i][j];
                cnt = 1;
            }
            if (cnt > n / 2) {
                b = true;
            }
        }
        if (b) ans2++;
    }

    cout << ans2 << endl << max;

    return 0;

}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1816 KiB
2Accepted0/0224ms9772 KiB
3Accepted4/43ms2144 KiB
4Accepted4/43ms2344 KiB
5Accepted4/43ms2540 KiB
6Accepted4/43ms2788 KiB
7Accepted4/43ms2848 KiB
8Accepted4/43ms2984 KiB
9Accepted4/43ms3068 KiB
10Accepted4/46ms3152 KiB
11Accepted6/63ms3208 KiB
12Accepted6/610ms3792 KiB
13Accepted6/627ms4188 KiB
14Accepted6/6209ms11332 KiB
15Accepted6/6209ms13156 KiB
16Accepted6/6239ms11808 KiB
17Accepted7/7122ms8012 KiB