254522026-02-20 10:20:33VizsimiKert (75 pont)python3Hibás válasz 34/75545ms19392 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 = {

    }
    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
base34/75
1Elfogadva0/016ms3264 KiB
2Hibás válasz0/0495ms5548 KiB
3Részben helyes2/417ms3124 KiB
4Részben helyes2/416ms2952 KiB
5Részben helyes2/417ms3124 KiB
6Részben helyes2/417ms3320 KiB
7Részben helyes2/417ms3128 KiB
8Részben helyes2/417ms3312 KiB
9Részben helyes2/417ms3312 KiB
10Részben helyes2/426ms3380 KiB
11Részben helyes3/617ms3000 KiB
12Részben helyes3/635ms3344 KiB
13Részben helyes3/679ms3628 KiB
14Részben helyes3/6476ms3892 KiB
15Időlimit túllépés0/6545ms19392 KiB
16Részben helyes3/6492ms5516 KiB
17Részben helyes3/7261ms4256 KiB