254862026-02-20 11:51:43VizsimiKert (75 pont)python3Time limit exceeded 57/75560ms18696 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):
    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
base57/75
1Accepted0/017ms3124 KiB
2Time limit exceeded0/0532ms5640 KiB
3Accepted4/417ms3112 KiB
4Accepted4/417ms3260 KiB
5Accepted4/417ms3320 KiB
6Accepted4/417ms3124 KiB
7Accepted4/417ms3184 KiB
8Accepted4/416ms3112 KiB
9Accepted4/416ms3072 KiB
10Accepted4/428ms3140 KiB
11Accepted6/618ms3380 KiB
12Accepted6/637ms3340 KiB
13Accepted6/682ms3680 KiB
14Time limit exceeded0/6532ms4132 KiB
15Time limit exceeded0/6560ms18696 KiB
16Time limit exceeded0/6513ms5552 KiB
17Accepted7/7293ms4248 KiB