241032026-02-04 12:10:10MangoÉrdekes túra (70 pont)python3Wrong answer 0/70497ms32000 KiB
h = int(input())
sz = input().split()
for i in range(h):
    sz[i] = int(sz[i])
s = [sz[0]]
v = 0
nagy = -1
for i in range(1,h-1):
    if sz[i] == s[len(s)-1]:
        if len(s) > 1:
            v += 1
        if len(s) > nagy:
            nagy = len(s)
        s.clear()
    s.append(sz[i])
    print(s,nagy,v)

if len(s) > nagy:
    nagy = len(s)
if len(s) > 0:
    v += 1

print(v,nagy, sep="\n")
SubtaskSumTestVerdictTimeMemory
base0/70
1Wrong answer0/017ms3116 KiB
2Time limit exceeded0/0483ms30772 KiB
3Wrong answer0/317ms3120 KiB
4Wrong answer0/314ms3056 KiB
5Wrong answer0/316ms2988 KiB
6Wrong answer0/316ms2948 KiB
7Wrong answer0/317ms3108 KiB
8Wrong answer0/317ms3132 KiB
9Wrong answer0/324ms3476 KiB
10Wrong answer0/330ms3724 KiB
11Wrong answer0/352ms4736 KiB
12Wrong answer0/392ms6432 KiB
13Wrong answer0/498ms6964 KiB
14Time limit exceeded0/4483ms30696 KiB
15Time limit exceeded0/4476ms31580 KiB
16Time limit exceeded0/4497ms29400 KiB
17Time limit exceeded0/4488ms32000 KiB
18Time limit exceeded0/4486ms28708 KiB
19Time limit exceeded0/4481ms32000 KiB
20Time limit exceeded0/4497ms31260 KiB
21Time limit exceeded0/4481ms32000 KiB
22Time limit exceeded0/4486ms30384 KiB