Problem p02639 (python)

Fixed submission:
#!python
given = [int(i) for i in input().split()]
ans = [1,2,3,4,5]

for i in range(len(ans)):
    if ans[i] != given[i]:
        print(ans[i])
        break

Buggy submission (verdict: Runtime Error):
X, N = [int(i) for i in input().split()]
if N == 0:
# if False:
    print(X)
else:
    Ps = set([int(i) for i in input().split()])
    if X not in Ps:
        print(X)

    # print(f'{X} {sorted(Ps)}')
    diff = 0
    while True:
        a = X - diff
        if a not in Ps:
            print(a)
            break
        a = X + diff
        if a not in Ps:
            print(a)
            break
        diff += 1

Buggy submission (verdict: Runtime Error):
X, N = [int(i) for i in input().split()]
if N == 0:
    print(X)
else:
    Ps = set([int(i) for i in input().split()])
    if not X in Ps:
        print(X)

    # print(f'{X} {sorted(Ps)}')
    diff = 0
    while True:
        a = X - diff
        if a not in Ps:
            print(a)
            break
        a = X + diff
        if a not in Ps:
            print(a)
            break
        diff += 1

Buggy submission (verdict: Runtime Error):
X, N = [int(i) for i in input().split()]
if N == 0:
    print(X)
else:
    Ps = set([int(i) for i in input().split()])
    if not X in Ps:
        print(X)

    diff = 0
    while True:
        if not X - diff in Ps:
            print(X - diff)
            break
        if not X + diff in Ps:
            print(X + diff)
            break
        diff += 1

Buggy submission (verdict: Runtime Error):
X, N = [int(i) for i in input().split()]
if N == 0:
    print(X)
else:
    Ps = set([int(i) for i in input().split()])
    if not X in Ps:
        print(X)

    diff = 0
    while True:
        if not X - diff in Ps:
            print(X - diff)
            break
        if not X + diff in Ps:
            print(X + diff)
            break
        diff += 1

Buggy submission (verdict: Runtime Error):
import sys

def main(args):
    # given = [(i, int(args[i])) for i in range(len(args))]
    # ans = sorted(given, key=lambda elm: elm[1])
    # print(ans[0][1]+1)

    ans = [1,2,3,4,5]
    given = [int(i) for i in args]

    for i in range(len(ans)):
        if ans[i] != given[i]:
            print(ans[i])
            return 0

main(sys.argv)

Buggy submission (verdict: Runtime Error):
import sys

def main(args):
    # given = [(i, int(args[i])) for i in range(len(args))]
    # ans = sorted(given, key=lambda elm: elm[1])
    # print(ans[0][1]+1)

    ans = [1,2,3,4,5]
    given = [int(i) for i in args]

    for i in range(len(ans)):
        if ans[i] != given[i]:
            print(ans[i])
            return 0

main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
import sys

def main(args):
    # given = [(i, int(args[i])) for i in range(len(args))]
    # ans = sorted(given, key=lambda elm: elm[1])
    # print(ans[0][1]+1)

    ans = [1,2,3,4,5]
    given = [int(i) for i in args]

    for i in range(len(ans)):
        if ans[i] != given[i]:
            print(ans[i])
            break

main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
import sys

def main(args):
    ans = [1,2,3,4,5]
    given = [int(i) for i in args]

    for i in range(len(ans)):
        if ans[i] != given[i]:
            print(i)
            break

main(sys.argv[1:])

Buggy submission (verdict: Runtime Error):
import sys

def main(args):
    ans = [1,2,3,4,5]
    given = [int(i) for i in args]

    for i in range(len(ans)):
        if ans[i] != given[i]:
            print(i)
            break


if __name__ == '__main__':
    main(sys.argv[1:])