35532023-02-28 21:51:40HorakZsofiKert (75 pont)cpp11Partially correct 71/75244ms3388 KiB
#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/03ms1684 KiB
2Accepted0/0226ms2092 KiB
3Partially correct2/43ms2268 KiB
4Accepted4/42ms2160 KiB
5Partially correct2/43ms2400 KiB
6Accepted4/43ms2604 KiB
7Accepted4/43ms2820 KiB
8Accepted4/43ms2904 KiB
9Accepted4/43ms3028 KiB
10Accepted4/47ms3144 KiB
11Accepted6/63ms3116 KiB
12Accepted6/612ms3140 KiB
13Accepted6/630ms3196 KiB
14Accepted6/6216ms3040 KiB
15Accepted6/6203ms3124 KiB
16Accepted6/6244ms3272 KiB
17Accepted7/7140ms3388 KiB