Buggy python submission (verdict: Runtime Error):
def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in s_li:
        v_1 = s_li.count(v - 1)
        v_0 = s_li.count(v) + s_li.count(v + 1)
        v_2 = s_li.count(v + 2)
        t_c = v_1 + v_0
        t_c2 = v_2 + v_0

        if t_c > count:
            count = t_c
        if t_c2 > count:
            count = t_c2
        if count > len(s_li):
            break
        s_li = s_li[s_li.index(v + 1):]
    print(count)


if __name__ == '__main__':
    main()

Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in s_li:
        v_1 = s_li.count(v - 1)
        v_0 = s_li.count(v) + s_li.count(v + 1)
        v_2 = s_li.count(v + 2)
        t_c = v_1 + v_0
        t_c2 = v_2 + v_0

        if t_c > count:
            count = t_c
        if t_c2 > count:
            count = t_c2
        if count > len(s_li):
            break
        s_li = s_li[s_li.index(v):]
    print(count)


if __name__ == '__main__':
    main()



Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in s_li:
        t_c = s_li.count(v - 1) + s_li.count(v) + s_li.count(v + 1)
        t_c2 = s_li.count(v) + s_li.count(v + 1) + s_li.count(v + 2)

        if t_c > count:
            count = t_c
        if t_c2 > count:
            count = t_c2
        if count > len(s_li):
            break
        s_li = s_li[s_li.index(v):]
    print(count)


if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in s_li:
        t_c = s_li.count(v - 1) + s_li.count(v) + s_li.count(v + 1)
        t_c2 = s_li.count(v) + s_li.count(v + 1) + s_li.count(v + 2)

        if t_c > count:
            count = t_c
        if t_c2 > count:
            count = t_c2
        if count > len(s_li):
            break
    print(count)


if __name__ == '__main__':
    main()



Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    c1 = 0
    b_num = s_li[0]
    for v in range(s_li[0] - 1, s_li[-1] + 1, 2):
        t_c = 0
        c1 = s_li.count(v - 1)
        c2 = s_li.count(v)
        c3 = s_li.count(v + 1)
        c4 = s_li.count(v + 2)

        t_c = c1 + c2 + c3
        t_c2 = c2 + c3 + c4
        if t_c > count:
            count = t_c
        if t_c2 > count:
            count = t_c2
        if c1 != 0:
            s_li = s_li[s_li.index(v - 1):]
        if count > len(s_li):
            break
        if t_c == 0:
            v = s_li[0]
    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    c1 = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1, 2):
        t_c = 0
        c1 = s_li.count(v - 1)
        c2 = s_li.count(v)
        c3 = s_li.count(v + 1)
        c4 = s_li.count(v + 2)

        t_c = c1 + c2 + c3
        t_c2 = c2 + c3 + c4
        if t_c > count:
            count = t_c
        if t_c2 > count:
            count = t_c2
        if c1 != 0:
            s_li = s_li[s_li.index(v - 1):]
        if count > len(s_li):
            break
    print(count)



if __name__ == '__main__':
    main()

Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    c1 = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        c1 = s_li.count(v - 1)
        c2 = s_li.count(v)
        c3 = s_li.count(v + 1)

        t_c = c1 + c2 + c3
        if t_c > count:
            count = t_c
        if c1 != 0:
            s_li = s_li[s_li.index(v - 1):]
        if count > len(s_li):
            break
    print(count)



if __name__ == '__main__':
    main()

Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    c1 = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        c1 = s_li.count(v - 1)
        c2 = s_li.count(v)
        c3 = s_li.count(v + 1)

        t_c = c1 + c2 + c3
        if t_c > count:
            count = t_c
        if c1 != 0:
            s_li = s_li[s_li.index(v - 1):]
    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    ind = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        t_c += s_li.count(v - 1)
        t_c += s_li.count(v)
        t_c += s_li.count(v + 1)
        if t_c > count:
            count = t_c
    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):


def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        for vv in s_li:
            if v == vv or v - 1 == vv or v + 1 == vv:
                t_c += 1
            if vv > v + 2:
                break
        if t_c > count:
            count = t_c

    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Runtime Error):
import read_val
import copy


def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        for vv in s_li:
            if v == vv or v - 1 == vv or v + 1 == vv:
                t_c += 1
            if vv > v + 2:
                break
        if t_c > count:
            count = t_c

    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        for vv in s_li:
            if v == vv or v - 1 == vv or v + 1 == vv:
                t_c += 1
            if vv > v + 2:
                break
        if t_c > count:
            count = t_c

    print(count)



if __name__ == '__main__':
    main()

Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        for vv in s_li:
            if v == vv or v - 1 == vv or v + 1 == vv:
                t_c += 1
            if vv + 2 > v:
                continue
        if t_c > count:
            count = t_c

    print(count)



if __name__ == '__main__':
    main()

Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Time Limit Exceeded):

def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in range(s_li[0] - 1, s_li[-1] + 1):
        t_c = 0
        for vv in s_li:
            if v == vv or v - 1 == vv or v + 1 == vv:
                t_c += 1
        if t_c > count:
            count = t_c

    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Runtime Error):
def main():
    t = input()
    if t == "1":
        print(input())
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in s_li:
        list_2 = list(filter(lambda x: x == v - 1 or x == v or x == v + 1, s_li))
        if len(list_2) > count:
            count = len(list_2)

    print(count)



if __name__ == '__main__':
    main()

Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))

Buggy python submission (verdict: Runtime Error):
import read_val
import copy


def main():
    t = input()
    if t == "1":
        print(input())
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in s_li:
        list_2 = list(filter(lambda x: x == v - 1 or x == v or x == v + 1, s_li))
        if len(list_2) > count:
            count = len(list_2)

    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))