238642026-01-31 10:07:52BoldizsárKert (75 pont)cpp17Partially correct 67/7597ms1080 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<int>szinek(n);
    bool before = false;int cnt = 0,ans = 1,current = 0,prev = -1;
    for(int i = 1;i <= m;i++){
        for(int j = 0;j < n;j++){
            cin >> szinek[j];
            if(szinek[j] == prev){
                current++;
            }else{
                current = 1;
                prev = szinek[j];
            }
            ans = max(ans,current);
        }
        sort(szinek.begin(),szinek.end());
        szinek.push_back(-1);
        prev = -1;current = 0;
        for(int j = 0;j <= n;j++){
            if(szinek[j] == prev){
                current++;
            }else{
                if(current > n/2 ) cnt++;
                current = 1;
                prev = szinek[j];
            }
            
        }
        current = 0;
    }
    cout <<cnt<<"\n"<<ans;
}
SubtaskSumTestVerdictTimeMemory
base67/75
1Accepted0/01ms316 KiB
2Accepted0/090ms316 KiB
3Partially correct2/41ms316 KiB
4Accepted4/41ms316 KiB
5Partially correct2/41ms348 KiB
6Partially correct2/41ms508 KiB
7Partially correct2/41ms316 KiB
8Accepted4/41ms316 KiB
9Accepted4/41ms332 KiB
10Accepted4/42ms316 KiB
11Accepted6/61ms320 KiB
12Accepted6/64ms316 KiB
13Accepted6/610ms436 KiB
14Accepted6/687ms464 KiB
15Accepted6/686ms1080 KiB
16Accepted6/697ms500 KiB
17Accepted7/750ms464 KiB