254672026-02-20 11:12:00VizsimiKert (75 pont)python3Wrong answer 30/75521ms19388 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):
    current = 1
    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 flowers[j] == flowers[j+1]:
            current += 1
        else:
            if current > highest:
                highest = current
                current = 1
print(majority)
print(highest)
SubtaskSumTestVerdictTimeMemory
base30/75
1Wrong answer0/016ms3124 KiB
2Wrong answer0/0490ms5552 KiB
3Partially correct2/416ms3124 KiB
4Accepted4/416ms3320 KiB
5Partially correct2/416ms3312 KiB
6Partially correct2/417ms3124 KiB
7Partially correct2/417ms3120 KiB
8Partially correct2/417ms3136 KiB
9Partially correct2/417ms3136 KiB
10Partially correct2/426ms3268 KiB
11Partially correct3/617ms2992 KiB
12Partially correct3/635ms3280 KiB
13Partially correct3/676ms3628 KiB
14Time limit exceeded0/6505ms4068 KiB
15Time limit exceeded0/6513ms19388 KiB
16Time limit exceeded0/6521ms5652 KiB
17Partially correct3/7263ms4256 KiB