254942026-02-20 12:14:43VizsimiKert (75 pont)python3Időlimit túllépés 57/75583ms19448 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 count[flowers[j]]*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)
RészfeladatÖsszpontTesztVerdiktIdőMemória
base57/75
1Elfogadva0/016ms3124 KiB
2Időlimit túllépés0/0583ms5552 KiB
3Elfogadva4/416ms3116 KiB
4Elfogadva4/417ms3124 KiB
5Elfogadva4/416ms3144 KiB
6Elfogadva4/416ms3124 KiB
7Elfogadva4/416ms3036 KiB
8Elfogadva4/417ms3312 KiB
9Elfogadva4/417ms3320 KiB
10Elfogadva4/428ms3380 KiB
11Elfogadva6/617ms3148 KiB
12Elfogadva6/637ms3300 KiB
13Elfogadva6/679ms3692 KiB
14Időlimit túllépés0/6551ms4052 KiB
15Időlimit túllépés0/6556ms19448 KiB
16Időlimit túllépés0/6504ms5564 KiB
17Elfogadva7/7287ms4256 KiB