Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
j = sum([ i % 10 for i in s ])
if j == 0:
    ans = 0
else:
    for i in range(n):
        tmp = sum(s)-s[i]
        if tmp % 10 != 0:
            ans = tmp
            break
print(ans)

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
j = sum([ i % 10 for i in s ])
if j == 0:
    ans = 0
else:
    if sum(s) % 10 != 0:
        ans = sum(s)
    else:
        for i in range(n):
            tmp = sum(s)-s[i]
            if tmp % 10 != 0:
                ans = tmp
                break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
pros = [ int(input()) for i in range(n)]
pros.sort()
tmp = sum(pros)
if tmp % 10 == 0:
    ttmp = sum(pros[0:-1])
    if ttmp % 10 == 0:
        ans = 0
else:
    ans = tmp
    
print(ans)

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
j = sum([ i % 10 for i in s ])
if j == 0:
    ans = 0
else:
    if sum(s) % 10 != 0:
        ans = sum(s)
    else:
        for i in range(n):
            tmp = sum(s)-s[i]
            if tmp % 10 != 0:
                ans = tmp
                break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
pros = [ int(input()) for i in range(n)]
k = set()
k.add(0)
for i in range(1 << len(pros)):
    output = []
    for j in range(len(pros)):
        if ((i >> j) & 1) == 1:
            output.append(pros[j])
    if sum(output) % 10 != 0:
        k.add(sum(output))
print(max(k))

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
j = sum([ i % 10 for i in s ])
if j == 0:
    ans = 0
else:
    if sum(s) % 10 != 0:
        ans = sum(s)
    else:
        for i in range(n):
            tmp = sum(s)-s[i]
            if tmp % 10 != 0:
                ans = tmp
                break
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
pros = [ int(input()) for i in range(n)]
k = set()
k.add(0)
for i in range(1 << len(pros)):
    output = []
    for j in range(len(pros)):
        if ((i >> j) & 1) == 1:
            output.append(pros[j])
    if sum(output) % 10 != 0:
        k.add(sum(output))
print(max(k))

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
j = sum([ i % 10 for i in s ])
if j == 0:
    ans = 0
else:
    if sum(s) % 10 != 0:
        ans = sum(s)
    else:
        for i in range(n):
            tmp = sum(s)-s[i]
            if tmp % 10 != 0:
                ans = tmp
                break
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
pros = [ int(input()) for i in range(n)]
k = set()
for i in range(1 << len(pros)):
    output = []
    for j in range(len(pros)):
        if ((i >> j) & 1) == 1:
            output.append(pros[j])
    if sum(output) % 10 != 0:
        k.add(sum(output))
print(max(k))

Fixed submission:
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
j = sum([ i % 10 for i in s ])
if j == 0:
    ans = 0
else:
    if sum(s) % 10 != 0:
        ans = sum(s)
    else:
        for i in range(n):
            tmp = sum(s)-s[i]
            if tmp % 10 != 0:
                ans = tmp
                break
print(ans)