254972026-02-20 12:18:54VizsimiKert (75 pont)python3Time limit exceeded 44/75600ms14696 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 state:
            if flowers[j] not in count:
                count[flowers[j]] = 0
            count[flowers[j]] += 1
            if max(count.values())*2 > N:
                majority += 1
                state = False
        if highest < N:
            if flowers[j] == flowers[j+1]:
                current += 1
            else:
                if current > highest:
                    highest = current
                current = 1
print(majority)
print(highest)
SubtaskSumTestVerdictTimeMemory
base44/75
1Accepted0/016ms3120 KiB
2Time limit exceeded0/0588ms5432 KiB
3Accepted4/416ms2988 KiB
4Accepted4/416ms3120 KiB
5Accepted4/416ms3076 KiB
6Accepted4/417ms3144 KiB
7Accepted4/416ms3140 KiB
8Accepted4/417ms3124 KiB
9Accepted4/418ms3052 KiB
10Accepted4/483ms3380 KiB
11Accepted6/620ms3148 KiB
12Accepted6/6153ms3380 KiB
13Time limit exceeded0/6600ms3628 KiB
14Time limit exceeded0/6600ms4012 KiB
15Time limit exceeded0/6583ms14696 KiB
16Time limit exceeded0/6584ms5292 KiB
17Time limit exceeded0/7578ms4024 KiB