254972026-02-20 12:18:54VizsimiKert (75 pont)python3Időlimit túllépés 44/75600ms14696 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 max(count.values())*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
base44/75
1Elfogadva0/016ms3120 KiB
2Időlimit túllépés0/0588ms5432 KiB
3Elfogadva4/416ms2988 KiB
4Elfogadva4/416ms3120 KiB
5Elfogadva4/416ms3076 KiB
6Elfogadva4/417ms3144 KiB
7Elfogadva4/416ms3140 KiB
8Elfogadva4/417ms3124 KiB
9Elfogadva4/418ms3052 KiB
10Elfogadva4/483ms3380 KiB
11Elfogadva6/620ms3148 KiB
12Elfogadva6/6153ms3380 KiB
13Időlimit túllépés0/6600ms3628 KiB
14Időlimit túllépés0/6600ms4012 KiB
15Időlimit túllépés0/6583ms14696 KiB
16Időlimit túllépés0/6584ms5292 KiB
17Időlimit túllépés0/7578ms4024 KiB