254832026-02-20 11:51:17VizsimiKert (75 pont)python3Runtime error 0/75105ms14812 KiB
a = input().split()
lines = int(a[0])
N = int(a[1])
colors = int(a[2])


majority = 0
highest = 1
for i in range(lines):
    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 count[flowers[j]] > N/2:
            majority += 1
            break
    for j in range(N):
        if flowers[j] == flowers[j+1]:
            current += 1
        else:
            if current > highest:
                highest = current
            current = 1
print(majority)
print(highest)
SubtaskSumTestVerdictTimeMemory
base0/75
1Runtime error0/016ms3116 KiB
2Runtime error0/026ms4200 KiB
3Runtime error0/416ms3120 KiB
4Runtime error0/416ms3120 KiB
5Runtime error0/416ms3124 KiB
6Runtime error0/417ms2928 KiB
7Runtime error0/416ms3124 KiB
8Runtime error0/417ms2956 KiB
9Runtime error0/416ms3116 KiB
10Runtime error0/417ms3056 KiB
11Runtime error0/617ms3060 KiB
12Runtime error0/617ms3124 KiB
13Runtime error0/618ms3400 KiB
14Runtime error0/620ms3640 KiB
15Runtime error0/6105ms14812 KiB
16Runtime error0/625ms4248 KiB
17Runtime error0/720ms3828 KiB