236032026-01-26 09:30:18BoldizsárKert (75 pont)cpp17Runtime error 24/7514ms3316 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int m,n,p;cin >> m >> n >> p;
    vector<vector<int>>szinek(m+1,vector<int>(n+1));
    bool volt = false;int cnt = 0,ans = 0,current = 0,prev =-1;
    for(int i = 1;i <= m;i++){
        for(int j = 1;j <= n;j++){
            int temp;cin >> temp;
            szinek[i][temp]++;
            if(szinek[i][temp]>n/2){
                volt = true;
            }
            if(temp == prev){
            current++;
            }else{
                prev = temp;
                current = 0;
            }
            ans = max(ans,current+1);
        }
        if(volt){
            cnt ++;volt = false;
        }

        
    }
    cout <<cnt<<"\n"<<ans;
}
SubtaskSumTestVerdictTimeMemory
base24/75
1Accepted0/02ms316 KiB
2Runtime error0/04ms2356 KiB
3Accepted4/41ms500 KiB
4Accepted4/41ms316 KiB
5Accepted4/41ms316 KiB
6Partially correct2/41ms316 KiB
7Accepted4/41ms316 KiB
8Runtime error0/41ms316 KiB
9Runtime error0/41ms316 KiB
10Runtime error0/41ms316 KiB
11Accepted6/62ms316 KiB
12Runtime error0/62ms316 KiB
13Runtime error0/61ms564 KiB
14Runtime error0/614ms2356 KiB
15Runtime error0/64ms3316 KiB
16Runtime error0/62ms2356 KiB
17Runtime error0/72ms1332 KiB