236022026-01-26 09:28:19BoldizsárKert (75 pont)cpp17Runtime error 24/7516ms3124 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 = 0;i < m;i++){
        for(int j = 0;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/01ms316 KiB
2Runtime error0/03ms2356 KiB
3Accepted4/41ms316 KiB
4Accepted4/41ms316 KiB
5Accepted4/41ms316 KiB
6Partially correct2/41ms316 KiB
7Accepted4/41ms508 KiB
8Runtime error0/41ms316 KiB
9Runtime error0/41ms500 KiB
10Runtime error0/41ms316 KiB
11Accepted6/62ms500 KiB
12Runtime error0/61ms316 KiB
13Runtime error0/61ms1012 KiB
14Runtime error0/616ms2612 KiB
15Runtime error0/64ms3124 KiB
16Runtime error0/63ms2356 KiB
17Runtime error0/72ms1332 KiB