236052026-01-26 09:34:08BoldizsárKert (75 pont)cpp17Runtime error 38/7534ms32000 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
	int m,n,p;cin >> m >> n >> p;
    vector<vector<int>>szinek(m+1,vector<int>(p+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
base38/75
1Accepted0/01ms316 KiB
2Runtime error0/034ms32000 KiB
3Accepted4/41ms512 KiB
4Accepted4/41ms316 KiB
5Accepted4/44ms4916 KiB
6Accepted4/44ms4916 KiB
7Accepted4/44ms4916 KiB
8Accepted4/46ms4916 KiB
9Accepted4/44ms4916 KiB
10Accepted4/46ms4916 KiB
11Accepted6/66ms4924 KiB
12Runtime error0/632ms32000 KiB
13Runtime error0/632ms32000 KiB
14Runtime error0/634ms32000 KiB
15Runtime error0/628ms32000 KiB
16Runtime error0/632ms32000 KiB
17Runtime error0/728ms32000 KiB