254982026-02-20 12:20:28VizsimiKert (75 pont)python3Elfogadva 75/75453ms19332 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 flowers[j] not in count:
            count[flowers[j]] = 0
        count[flowers[j]] += 1

        if highest < N:
            if flowers[j] == flowers[j+1]:
                current += 1
            else:
                if current > highest:
                    highest = current
                current = 1
    if max(count.values())*2 > N:
        majority += 1
print(majority)
print(highest)
RészfeladatÖsszpontTesztVerdiktIdőMemória
base75/75
1Elfogadva0/016ms3120 KiB
2Elfogadva0/0425ms5624 KiB
3Elfogadva4/416ms3124 KiB
4Elfogadva4/416ms3116 KiB
5Elfogadva4/416ms2948 KiB
6Elfogadva4/416ms2944 KiB
7Elfogadva4/417ms3124 KiB
8Elfogadva4/417ms3324 KiB
9Elfogadva4/417ms3168 KiB
10Elfogadva4/425ms3504 KiB
11Elfogadva6/617ms3172 KiB
12Elfogadva6/634ms3400 KiB
13Elfogadva6/665ms3636 KiB
14Elfogadva6/6412ms3948 KiB
15Elfogadva6/6442ms19332 KiB
16Elfogadva6/6453ms5532 KiB
17Elfogadva7/7229ms4168 KiB