238572026-01-31 09:57:31BoldizsárKert (75 pont)cpp17Hibás válasz 63/7593ms1084 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 = 1,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 = 1;
        for(int j = 0;j < n;j++){
            if(szinek[j] == prev){
                current++;
            }else{
                if(current > n/2) cnt++;
                current = 1;
                prev = szinek[j];
            }
            
        }
        current = 1;
    }
    cout <<cnt<<"\n"<<ans;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base63/75
1Hibás válasz0/01ms316 KiB
2Elfogadva0/090ms512 KiB
3Részben helyes2/41ms316 KiB
4Részben helyes2/41ms316 KiB
5Részben helyes2/41ms316 KiB
6Részben helyes2/41ms316 KiB
7Részben helyes2/41ms508 KiB
8Részben helyes2/41ms316 KiB
9Elfogadva4/41ms316 KiB
10Elfogadva4/43ms316 KiB
11Elfogadva6/61ms560 KiB
12Elfogadva6/64ms436 KiB
13Elfogadva6/610ms320 KiB
14Elfogadva6/686ms316 KiB
15Elfogadva6/683ms1084 KiB
16Elfogadva6/693ms500 KiB
17Elfogadva7/748ms464 KiB