90142024-02-12 10:20:39IgnácKert (75 pont)cpp17Accepted 75/75300ms4636 KiB
// Source: https://usaco.guide/general/io

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

int main() {
	int m, n, k;
	cin >> m >> n >> k;
	int db = 0, maxi = 0;
	for (int i = 0; i < m; i++) {
		map<int, int> a;
		int last = 0, crdb = 0, crmaxi = 0;
		for (int j = 0; j < n; j++) {
			int b;
			cin >> b;
			if (b == last) crdb++;
			else {
				crdb = 1;
				last = b;
			}
			if (crdb > maxi) maxi = crdb;
			a[b]++;
			if (a[b] > crmaxi) crmaxi = a[b];
		}
		
		if (crmaxi > n / 2) db++;
	}

	cout << db << "\n" << maxi;
}
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/03ms1692 KiB
2Accepted0/0279ms2092 KiB
3Accepted4/43ms2408 KiB
4Accepted4/43ms2552 KiB
5Accepted4/43ms2640 KiB
6Accepted4/43ms2852 KiB
7Accepted4/43ms2932 KiB
8Accepted4/43ms2992 KiB
9Accepted4/43ms3208 KiB
10Accepted4/48ms3280 KiB
11Accepted6/64ms3388 KiB
12Accepted6/614ms3624 KiB
13Accepted6/637ms3724 KiB
14Accepted6/6266ms3816 KiB
15Accepted6/6250ms3900 KiB
16Accepted6/6300ms4156 KiB
17Accepted7/7168ms4636 KiB