2192021-03-04 23:21:02mraronKert (75 pont)cpp14Accepted 75/75232ms19860 KiB
#include<bits/stdc++.h>
using namespace std;
int main() {
	int n,m,k;
	cin>>n>>m>>k;
	int ans1=0, ans2=0;
	for(int i=0;i<n;++i) {
		vector<int> lst(m);
		for(int j=0;j<m;++j) {
			cin>>lst[j];
		}	
		int cans=1;
		int curr=1;
		for(int j=1;j<m;++j) {
			if(lst[j]==lst[j-1]) curr++;
			else curr=1;
			cans=max(cans, curr);
		}
		ans2=max(ans2, cans);
		
		sort(lst.begin(), lst.end());
		
		cans=1;
		curr=1;
		for(int j=1;j<m;++j) {
			if(lst[j]==lst[j-1]) curr++;
			else curr=1;
			cans=max(cans, curr);
		}
		if(2*cans>m) ans1++;
	}
	cout<<ans1<<"\n";
	cout<<ans2<<"\n";
	return 0;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/02ms1772 KiB
2Accepted0/0217ms5724 KiB
3Accepted4/41ms5740 KiB
4Accepted4/41ms5744 KiB
5Accepted4/41ms5744 KiB
6Accepted4/41ms5744 KiB
7Accepted4/41ms5752 KiB
8Accepted4/41ms5752 KiB
9Accepted4/41ms5760 KiB
10Accepted4/44ms5768 KiB
11Accepted6/62ms5824 KiB
12Accepted6/68ms5968 KiB
13Accepted6/621ms6368 KiB
14Accepted6/6186ms9744 KiB
15Accepted6/6187ms13912 KiB
16Accepted6/6232ms17692 KiB
17Accepted7/7108ms19860 KiB