9612022-02-05 17:27:25Kevinke12Kert (75 pont)cpp14Partially correct 68/75214ms26000 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long

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

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/02ms1760 KiB
2Accepted0/0211ms14108 KiB
3Partially correct2/41ms5768 KiB
4Accepted4/41ms5764 KiB
5Partially correct2/41ms5800 KiB
6Accepted4/41ms5804 KiB
7Accepted4/41ms5808 KiB
8Accepted4/41ms5816 KiB
9Accepted4/42ms5840 KiB
10Accepted4/44ms6072 KiB
11Accepted6/62ms5916 KiB
12Accepted6/68ms6444 KiB
13Accepted6/628ms7820 KiB
14Accepted6/6196ms18596 KiB
15Partially correct3/6189ms16808 KiB
16Accepted6/6214ms26000 KiB
17Accepted7/7131ms23712 KiB