254432026-02-20 09:56:59VizsimiKert (75 pont)python3Futási hiba 22/75135ms32000 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 = [0]*(colors+1)
    flowers = [int(x) for x in input().split()]
    flowers.append(0)

    for j in range(N):
        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)
RészfeladatÖsszpontTesztVerdiktIdőMemória
base22/75
1Elfogadva0/016ms3120 KiB
2Futási hiba0/043ms32000 KiB
3Részben helyes2/417ms3144 KiB
4Részben helyes2/417ms3112 KiB
5Részben helyes2/421ms4652 KiB
6Részben helyes2/421ms4684 KiB
7Részben helyes2/421ms4660 KiB
8Részben helyes2/421ms4612 KiB
9Részben helyes2/423ms4660 KiB
10Részben helyes2/429ms4904 KiB
11Részben helyes3/625ms5392 KiB
12Részben helyes3/6135ms26628 KiB
13Futási hiba0/637ms32000 KiB
14Futási hiba0/641ms32000 KiB
15Futási hiba0/641ms32000 KiB
16Futási hiba0/643ms32000 KiB
17Futási hiba0/741ms32000 KiB