9642022-02-05 17:35:41Kevinke12Kert (75 pont)cpp14Accepted 75/75266ms20464 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long

ll N, M, P;
ll t[100005];

int main()
{
    cin >> N >> M >> P;

    int ans1=0, ans2=0;

    for(int i = 0; i < N; i++)
    {
        for(int j = 0; j < M;j++)
            cin >> t[j];

        //1. subtask
        map<ll, int> m;
        for(int j = 0;j < M; j++)
            m[t[j]]++;
        int mDb=0;
        for(auto aktErt:m)
        {
            mDb = max(mDb, aktErt.second);
        }
        if(mDb>M-mDb)
            ans1++;

        //2. subtask
        int aktDb=1;
        for(int j = 1;j <= M; j++)
        {
            if(t[j-1]==t[j])
                aktDb++;
            else
            {
                ans2 = max(ans2, aktDb);
                aktDb=1;
            }
        }
    }



    cout << ans1 << "\n";
    cout << ans2 << "\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1744 KiB
2Accepted0/0208ms5948 KiB
3Accepted4/41ms5760 KiB
4Accepted4/41ms5760 KiB
5Accepted4/41ms5768 KiB
6Accepted4/41ms5772 KiB
7Accepted4/41ms5784 KiB
8Accepted4/41ms5784 KiB
9Accepted4/42ms5784 KiB
10Accepted4/46ms5836 KiB
11Accepted6/62ms5856 KiB
12Accepted6/610ms6032 KiB
13Accepted6/626ms6644 KiB
14Accepted6/6208ms9948 KiB
15Accepted6/6185ms14840 KiB
16Accepted6/6266ms17976 KiB
17Accepted7/7143ms20464 KiB