35542023-02-28 21:51:50Zoli9Kert (75 pont)cpp17Partially correct 71/75247ms4164 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;
}
SubtaskSumTestVerdictTimeMemory
base71/75
1Accepted0/03ms1808 KiB
2Accepted0/0231ms2176 KiB
3Partially correct2/43ms2372 KiB
4Accepted4/43ms2440 KiB
5Partially correct2/43ms2652 KiB
6Accepted4/43ms3012 KiB
7Accepted4/43ms3212 KiB
8Accepted4/43ms3300 KiB
9Accepted4/43ms3520 KiB
10Accepted4/47ms3476 KiB
11Accepted6/63ms3516 KiB
12Accepted6/612ms3668 KiB
13Accepted6/632ms3808 KiB
14Accepted6/6222ms3912 KiB
15Accepted6/6208ms3984 KiB
16Accepted6/6247ms3900 KiB
17Accepted7/7142ms4164 KiB