254872026-02-20 11:55:05VizsimiKert (75 pont)python3Time limit exceeded 57/75549ms19500 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
    if highest != N:
        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/016ms3324 KiB
2Time limit exceeded0/0542ms5620 KiB
3Accepted4/416ms3124 KiB
4Accepted4/417ms3120 KiB
5Accepted4/416ms3116 KiB
6Accepted4/417ms3008 KiB
7Accepted4/416ms3136 KiB
8Accepted4/416ms3124 KiB
9Accepted4/417ms3124 KiB
10Accepted4/427ms3364 KiB
11Accepted6/618ms3124 KiB
12Accepted6/637ms3380 KiB
13Accepted6/679ms3692 KiB
14Time limit exceeded0/6532ms4096 KiB
15Time limit exceeded0/6549ms19500 KiB
16Time limit exceeded0/6537ms5548 KiB
17Accepted7/7289ms4264 KiB