9632022-02-05 17:35:00Kevinke12Kert (75 pont)cpp14Partially correct 71/75298ms20484 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
base71/75
1Accepted0/03ms1856 KiB
2Accepted0/0250ms6020 KiB
3Partially correct2/41ms5820 KiB
4Accepted4/41ms5824 KiB
5Partially correct2/41ms5828 KiB
6Accepted4/42ms5836 KiB
7Accepted4/41ms5844 KiB
8Accepted4/41ms5848 KiB
9Accepted4/42ms5852 KiB
10Accepted4/48ms6012 KiB
11Accepted6/63ms5920 KiB
12Accepted6/69ms6112 KiB
13Accepted6/628ms6744 KiB
14Accepted6/6298ms10008 KiB
15Accepted6/6280ms14908 KiB
16Accepted6/6277ms17952 KiB
17Accepted7/7135ms20484 KiB