93472024-02-20 17:58:20FarkasZénóKert (75 pont)python3Accepted 75/75402ms47312 KiB
from sys import stdin
from collections import defaultdict

M, N, P = [int(x) for x in stdin.readline().split()]
tobbseg = 0
leghosszabb = 1
for _ in range(M):
	viragok = [int(x) for x in stdin.readline().split()]
	szamolo = defaultdict(int)
	for virag in viragok:
		szamolo[virag] += 1
	if max(szamolo.values()) > N // 2:
		tobbseg += 1
	elozo = viragok[0]
	szeria = 1
	for mostani in viragok[1:]:
		if mostani == elozo:
			szeria += 1
			leghosszabb = max(leghosszabb, szeria)
		else:
			szeria = 1
		elozo = mostani
print(tobbseg)
print(leghosszabb)
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/020ms12032 KiB
2Accepted0/0386ms16628 KiB
3Accepted4/420ms13484 KiB
4Accepted4/420ms13140 KiB
5Accepted4/420ms13552 KiB
6Accepted4/420ms13584 KiB
7Accepted4/419ms13972 KiB
8Accepted4/419ms14060 KiB
9Accepted4/420ms13820 KiB
10Accepted4/428ms14732 KiB
11Accepted6/623ms14204 KiB
12Accepted6/637ms14964 KiB
13Accepted6/668ms15172 KiB
14Accepted6/6384ms16692 KiB
15Accepted6/6402ms47312 KiB
16Accepted6/6386ms18128 KiB
17Accepted7/7221ms17012 KiB