35552023-02-28 21:52:25Zoli9Kert (75 pont)cpp17Partially correct 71/75245ms4376 KiB
//HZsófi

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n, m, sz;
	cin>>n>>m>>sz;
	int szaml=0;
	int szaml2=0;
	for(int i=1; i<n+1; i++){
		int azon=0;
		int az=0;
		map<int, int>szin;
		for(int j=1; j<m+1; j++){
			int a;
			cin>>a;
			szin[a]++;
			if(az==a){
				azon++;
			}
			else{
				if(szaml2<azon){
					szaml2=azon;
				}
				azon=1;
				az=a;
			}
		}
		int maxi=0;
		for(auto x: szin){
			if(maxi<x.second){
				maxi=x.second;
			}
		}
		if(maxi>m/2){
			szaml++;
		}
	}
cout<<szaml<<endl<<szaml2<<endl;
}
SubtaskSumTestVerdictTimeMemory
base71/75
1Accepted0/03ms1684 KiB
2Accepted0/0240ms2016 KiB
3Partially correct2/43ms2180 KiB
4Accepted4/43ms2300 KiB
5Partially correct2/43ms2516 KiB
6Accepted4/43ms2728 KiB
7Accepted4/43ms2844 KiB
8Accepted4/43ms2940 KiB
9Accepted4/43ms3152 KiB
10Accepted4/47ms3368 KiB
11Accepted6/63ms3404 KiB
12Accepted6/612ms3428 KiB
13Accepted6/630ms3564 KiB
14Accepted6/6217ms3476 KiB
15Accepted6/6204ms3736 KiB
16Accepted6/6245ms4024 KiB
17Accepted7/7142ms4376 KiB