Buggy python submission (verdict: Time Limit Exceeded):
import itertools

maxnum=0

def parm_check(n,maxnum):
    #print(tmp)
    #print(list(itertools.combinations(a,n)))
    a_sort = sorted(a,reverse=True)
    comb = list(itertools.combinations(a_sort,n))
    for j in range(len(comb)):
        sumnum = sum(comb[j])
        if(sumnum % 10 != 0 and maxnum < sumnum):
            maxnum = sumnum
            break
    return maxnum

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        for i in range(N-1,1,-1):
            maxnum = parm_check(i,maxnum)
            if(maxnum != 0):
                break

        print(maxnum)


Fixed submission:
maxnum=0

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        a_sort = sorted(a)
        for i in range(0,N):
            if(a_sort[i] % 10 != 0):
                del a_sort[i]
                maxnum = sum(a_sort)
                break
            

        print(maxnum)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

maxnum=0

def parm_check(n,maxnum):
    #print(tmp)
    #print(list(itertools.combinations(a,n)))
    comb = list(itertools.combinations(a,n))
    for j in range(len(comb)):
        sumnum = sum(comb[j])
        if(sumnum % 10 != 0 and maxnum < sumnum):
            maxnum = sumnum
    
    return maxnum

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        for i in range(N-1,1,-1):
            maxnum = parm_check(i,maxnum)
            if(maxnum != 0):
                break

        print(maxnum)


Fixed submission:
maxnum=0

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        a_sort = sorted(a)
        for i in range(0,N):
            if(a_sort[i] % 10 != 0):
                del a_sort[i]
                maxnum = sum(a_sort)
                break
            

        print(maxnum)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

maxnum=0

def parm_check(n,maxnum):
    if(n >= 2):
        #print(tmp)
        #print(list(itertools.combinations(a,n)))
        comb = list(itertools.combinations(a,n))
        for j in range(len(comb)):
            if(sum(comb[j]) % 10 != 0 and maxnum < sum(comb[j])):
                maxnum = sum(comb[j])
    else:
        for j in range(N):
            #print(tmp[j])
            if(a[j] % 10 != 0 and maxnum < a[j]):
                maxnum=a[j]
    
    return maxnum

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        for i in range(N-1,1,-1):
            maxnum = parm_check(i,maxnum)
            if(maxnum != 0):
                break

        print(maxnum)


Fixed submission:
maxnum=0

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        a_sort = sorted(a)
        for i in range(0,N):
            if(a_sort[i] % 10 != 0):
                del a_sort[i]
                maxnum = sum(a_sort)
                break
            

        print(maxnum)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import itertools

maxnum=0

def parm_check(n,maxnum):
    if(n >= 2):
        #print(tmp)
        #print(list(itertools.combinations(a,n)))
        comb = list(itertools.combinations(a,n))
        for j in range(len(comb)):
            if(sum(comb[j]) % 10 != 0 and maxnum < sum(comb[j])):
                maxnum = sum(comb[j])
    else:
        tmp= copy.deepcopy(a)
        for j in range(N):
            #print(tmp[j])
            if(tmp[j] % 10 != 0 and maxnum < tmp[j]):
                maxnum=tmp[j]
    
    return maxnum

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        for i in range(1,N):
            maxnum = parm_check(i,maxnum)

        print(maxnum)


Fixed submission:
maxnum=0

if(__name__=="__main__"):
    N = int(input())
    a =[int(input()) for i in range(N)]
    #print(sum(a))
    
    if(sum(a) % 10 != 0):
        print(sum(a))
    else:
        a_sort = sorted(a)
        for i in range(0,N):
            if(a_sort[i] % 10 != 0):
                del a_sort[i]
                maxnum = sum(a_sort)
                break
            

        print(maxnum)