254662026-02-20 11:10:50VizsimiKert (75 pont)python3Hibás válasz 33/75546ms19448 KiB
a = input().split()
lines = int(a[0])
N = int(a[1])
colors = int(a[2])


majority = 0

highest = 0
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)
RészfeladatÖsszpontTesztVerdiktIdőMemória
base33/75
1Hibás válasz0/016ms3124 KiB
2Időlimit túllépés0/0513ms5552 KiB
3Részben helyes2/416ms3124 KiB
4Elfogadva4/416ms3116 KiB
5Részben helyes2/417ms3320 KiB
6Részben helyes2/416ms3136 KiB
7Részben helyes2/417ms3124 KiB
8Részben helyes2/416ms3124 KiB
9Részben helyes2/417ms3116 KiB
10Részben helyes2/427ms3364 KiB
11Részben helyes3/617ms3144 KiB
12Részben helyes3/637ms3272 KiB
13Részben helyes3/678ms3572 KiB
14Részben helyes3/6481ms4088 KiB
15Időlimit túllépés0/6546ms19448 KiB
16Időlimit túllépés0/6504ms5640 KiB
17Részben helyes3/7259ms4212 KiB