254982026-02-20 12:20:28VizsimiKert (75 pont)python3Accepted 75/75453ms19332 KiB
a = input().split()
lines = int(a[0])
N = int(a[1])
colors = int(a[2])

current = 1
majority = 0
highest = 1


for i in range(lines):
    state = True
    count = {

    }
    flowers = [int(x) for x in input().split()]
    flowers.append(0)

    for j in range(N):
        if flowers[j] not in count:
            count[flowers[j]] = 0
        count[flowers[j]] += 1

        if highest < N:
            if flowers[j] == flowers[j+1]:
                current += 1
            else:
                if current > highest:
                    highest = current
                current = 1
    if max(count.values())*2 > N:
        majority += 1
print(majority)
print(highest)
SubtaskSumTestVerdictTimeMemory
base75/75
1Accepted0/016ms3120 KiB
2Accepted0/0425ms5624 KiB
3Accepted4/416ms3124 KiB
4Accepted4/416ms3116 KiB
5Accepted4/416ms2948 KiB
6Accepted4/416ms2944 KiB
7Accepted4/417ms3124 KiB
8Accepted4/417ms3324 KiB
9Accepted4/417ms3168 KiB
10Accepted4/425ms3504 KiB
11Accepted6/617ms3172 KiB
12Accepted6/634ms3400 KiB
13Accepted6/665ms3636 KiB
14Accepted6/6412ms3948 KiB
15Accepted6/6442ms19332 KiB
16Accepted6/6453ms5532 KiB
17Accepted7/7229ms4168 KiB