9602022-02-05 17:26:58Kevinke12Kert (75 pont)cpp14Partially correct 68/75232ms25692 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long

ll N, M, P;
ll t[105][10000];

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

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

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

            }
        }
    }

    cout << ans1 << "\n";
    cout << ans2 << "\n";
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base68/75
1Accepted0/02ms1840 KiB
2Accepted0/0231ms13752 KiB
3Partially correct2/41ms5844 KiB
4Accepted4/41ms5844 KiB
5Partially correct2/41ms5860 KiB
6Accepted4/41ms5864 KiB
7Accepted4/41ms5876 KiB
8Accepted4/41ms5884 KiB
9Accepted4/42ms5892 KiB
10Accepted4/44ms6216 KiB
11Accepted6/62ms5968 KiB
12Accepted6/69ms6596 KiB
13Accepted6/632ms7880 KiB
14Accepted6/6210ms18640 KiB
15Partially correct3/6192ms15652 KiB
16Accepted6/6232ms25692 KiB
17Accepted7/7142ms24740 KiB