ZhenlongDai/ACPR huggingface dataset:
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
s.sort()
print(sum(s))
if sum(s) % 10 != 0:
    print(sum(s))
else:
    for i in range(n):
        if s[i] % 10 != 0:
            print(sum(s) - s[i])
            exit()
    print(0)

Failing test case input:
3
7
38
-1

Expected output:
44


Actual output:
44
44


Fixed submission (verdict: Accepted):
n = int(input())
s = []
for i in range(n):
    s.append(int(input()))
s.sort()

if sum(s) % 10 != 0:
    print(sum(s))
else:
    for i in range(n):
        if s[i] % 10 != 0:
            print(sum(s) - s[i])
            exit()
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = int(input())
list=[]
for i in range(a):
    list.append(int(input()))

if not sum(list)%10==0:
    print(sum(list))
else:
    for i in sorted(list):
        if not i%10==0:
            print(sum(list)-i)
            break
    print(0)

Failing test case input:
3
1
8
1

Expected output:
9


Actual output:
9
0


Fixed submission (verdict: Accepted):
a = int(input())
list=[]
for i in range(a):
    list.append(int(input()))

if not sum(list)%10==0:
    print(sum(list))
else:
    for i in sorted(list):
        if not i%10==0:
            print(sum(list)-i)
            exit()
    print(0)

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())



sl = []
for i in range(n):
    sl.append(int(input()))

total = sum(sl)
sl.sort()

if total % 10 == 0:
    ans = 0
    for i in range(n):
        if (total-sl[i]) % 10 != 0:
            ans = total
            break
else:
    ans = total
print(ans)


Failing test case input:
3
-4
2
22

Expected output:
24


Actual output:
20


Fixed submission (verdict: Accepted):
n = int(input())



sl = []
for i in range(n):
    sl.append(int(input()))

total = sum(sl)
sl.sort()

if total % 10 == 0:
    ans = 0
    for i in range(n):
        if sl[i]%10!=0:
            ans=total-sl[i]
            break
else:
    ans = total
print(ans)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read

N = int(input())
S = list(map(int, read().rstrip().split()))
sumS = sum(S)

if sumS % 10 != 0:
    print(sumS)
else:
    if all(s % 10 == 0 for s in S):
        print(0)
    else:
        S = sorted(S)
        for s in S:
            if s % 10 != 0:
                t = s
                break
        print(sumS - t)

Failing test case input:
3
-26
0
-1

Expected output:
-27


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = [int(input()) for _ in range(N)]
sumS = sum(S)
if all(s % 10 == 0 for s in S):
    print(0)
elif sumS % 10 != 0:
    print(sumS)
else:
    S = sorted(S)
    for s in S:
        if s % 10 != 0:
            t = s
            break
    print(sumS - t)
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=[int(input()) for i in range(n)]

li=[]
for i in s:
    if i%10!=0:
        li.append(i)
        
li.sort()

if len(li)>0:
    print(sum(s)-li[0])
else:
    print(0)

Failing test case input:
3
-11
1
4

Expected output:
-6


Actual output:
5


Fixed submission (verdict: Accepted):
n=int(input())
s=[int(input()) for i in range(n)]

li=[]
for i in s:
    if i%10!=0:
        li.append(i)
        
li.sort()

if n==1:
    print(0 if s[0]%10==0 else li[0])
elif len(li)>0:
    print(sum(s)-li[0] if sum(s)%10==0 else sum(s))
else:
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
T=int(input())
si=[]
sum=0
for i in range(T):
  si.append(int(input()))
si.sort()
for k in range(T):
    sum=sum+si[k]
if sum%10!=0:
    print(sum)
else:
    for j in range(T):
        if si[j]%10!=0:
            sum=sum-si[j]
            break
        else:
            pass
    if sum%10==0:
        sum=0
    else:
        pass
    print(sum)
print(si)


Failing test case input:
3
8
10
15

Expected output:
33


Actual output:
33
[8, 10, 15]


Fixed submission (verdict: Accepted):
T=int(input())
si=[]
sum=0
for i in range(T):
  si.append(int(input()))
si.sort()
for k in range(T):
    sum=sum+si[k]
if sum%10!=0:
    print(sum)
else:
    for j in range(T):
        if si[j]%10!=0:
            sum=sum-si[j]
            break
        else:
            pass
    if sum%10==0:
        sum=0
    else:
        pass
    print(sum)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ls = [int(input()) for _ in range(n)]

ls.append(0)
ls.sort()

ans = sum(ls)

for i in range(n):
	ans -= ls[i]
	if ans % 10 != 0:
		print(ans)
		break
	elif i == n - 1:
		print(0)

Failing test case input:
3
-25
4
0

Expected output:
-21


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
ls = [int(input()) for _ in range(n)]

ls.sort()

ans = sum(ls)

if ans % 10 != 0:
	print(ans)
else:
	for i in range(n):
		if ls[i] % 10 != 0:
			print(ans - ls[i])
			break
		elif i == n - 1:
			print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
a=sorted(a)
S=sum(a)
if S%10!=0:
  print(S)
else:
  for i in range(n):
    if (S-a[i])%10:
      print(S-a[i])
      exit()
print(0)

Failing test case input:
3
-38
0
0

Expected output:
-38


Actual output:
-38
0


Fixed submission (verdict: Accepted):
n=int(input())
a=[0]*n
for i in range(n):
  a[i]=int(input())
a=sorted(a)
S=sum(a)
if S%10!=0:
  print(S)
  exit()
else:
  for i in range(n):
    if (S-a[i])%10:
      print(S-a[i])
      exit()
print(0)
Problem: p03699
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
def main():
    
    
    
    
    
    
    
    
    
    
    
    
    
    n = int(input())
    s = sorted(list(int(input()) for i in range(n)))
    ans = [0]*n

    ans[0] = s[0]
    for i in range(1,n):
        ans[i] = ans[i-1] + s[i]
    for i in range(1,n+1):
        if ans[0-i] % 10 != 0:
            print(ans[0-i])
            return 0
    print(0)
       
if __name__ == '__main__':
    main()



Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
2


Fixed submission (verdict: Accepted):
def main():
    
    
    
    
    
    
    
    
    
    
    
    
    
    n = int(input())
    s = list(int(input()) for i in range(n))
    maxa = sum(s)
    if maxa % 10 != 0:
        print(maxa)
        return 0
    div = sorted([i for i in s if i % 10 != 0])
    if len(div) > 0:
        print(maxa-div[0])
    else:
        print(0)
       
if __name__ == '__main__':
    main()

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a = [int(input()) for _ in range(n)]
ans=0
a.sort()
for i in a:
    if sum(a)%10 == 0:
        a.remove(i)
    else:
        print(sum(a))
        exit(0)
print(0)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
a = [int(input()) for _ in range(n)]
ans=0
a.sort()
for i in range(n):
    if sum(a)%10 == 0:
        if a[i]%10 == 0:
            pass
        else:
            a[i]=0
    else:
        print(sum(a))
        exit(0)
print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
p = [int(input()) for i in range(N)]
ans = sum(p)
s = list(filter(lambda x: x % 10 != 0, p))
print(len(s))
if ans % 10 == 0:
    if len(s) == 0:
        print(int(0))
    else:
        ans = ans - min(s)
        print(ans)
else:
    print(ans)

Failing test case input:
3
-512
-1
-1

Expected output:
-514


Actual output:
3
-514


Fixed submission (verdict: Accepted):
N = int(input())
p = [int(input()) for i in range(N)]
ans = sum(p)
s = list(filter(lambda x: x % 10 != 0, p))
if ans % 10 == 0:
    if len(s) == 0:
        print(int(0))
    else:
        ans = ans - min(s)
        print(ans)
else:
    print(ans)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
li=[]

for n in range(N):
  li.append(int(input()))

li.sort()
S=sum(li)


while S%10==0 and li!=[]:
  if li[0]%10==0:
    li.pop(0)
  else:
    S-=li.pop(0)

print(S)

Failing test case input:
3
10
20
40

Expected output:
0


Actual output:
70


Fixed submission (verdict: Accepted):
N=int(input())
li=[]

for n in range(N):
  li.append(int(input()))

li.sort()
S=sum(li)


while S%10==0 and li!=[]:
  if li[0]%10==0:
    li.pop(0)
  else:
    S-=li.pop(0)
if li==[]:
  print(0)
else:
  print(S)
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
read = sys.stdin.buffer.read

N = int(input())
S = list(map(int, read().rstrip().split()))
sumS = sum(S)
if all(s % 10 == 0 for s in S):
    print(0)
elif sumS % 10 != 0:
    print(sumS)
else:
    S = sorted(S)
    for s in S:
        if s % 10 != 0:
            t = s
            break
    print(sumS - t)

Failing test case input:
3
-18
4
1

Expected output:
-13


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = [int(input()) for _ in range(N)]
sumS = sum(S)
if all(s % 10 == 0 for s in S):
    print(0)
elif sumS % 10 != 0:
    print(sumS)
else:
    S = sorted(S)
    for s in S:
        if s % 10 != 0:
            t = s
            break
    print(sumS - t)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

DIM = int(input())
args = [int(input()) for a in range(DIM)]
while(DIM>0):
    comb = list(itertools.combinations(args, DIM))
    combMax = list(map(sum, comb))
    for c in combMax:
        if c%10==0:
            continue
        else:
            print(c)
            exit()
    DIM = DIM -1

Failing test case input:
3
10
20
40

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
import itertools

DIM = int(input())
args = [int(input()) for a in range(DIM)]
temp = list(map(lambda x:x%10, args))
if sum(temp) == 0:
    print(0)
    exit()
i = DIM
while(i>0):
    comb = list(itertools.combinations(args, i))
    combMax = list(map(sum, comb))
    for c in sorted(combMax, reverse=True):
        if c%10==0:
            continue
        else:
            print(c)
            exit()
    i = i -1
print(0)
exit()

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N, *s = map(int, open(0).read().split())
ans = sum(s)
for i in sorted(s):
    if i % 10 != 0:
        ans -= i
        break
print(ans)

Failing test case input:
3
-38
1
2

Expected output:
-35


Actual output:
3


Fixed submission (verdict: Accepted):
N, *s = map(int, open(0).read().split())
ans = sum(s)
for v in sorted(s):
    if v % 10 != 0:
        print(ans if ans % 10 != 0 else ans - v)
        break
else:
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [int(input()) for _ in range(n)]
s_0 = [num for num in s if num % 10 != 0]
if len(s_0) == 0: print(0)
else: print(sum(s) - min(s_0))

Failing test case input:
3
0
-38
1

Expected output:
-37


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
s = [int(input()) for _ in range(n)]
s_0 = [num for num in s if num % 10 != 0]
if len(s_0) == 0: print(0)
elif sum(s) % 10 == 0: print(sum(s) - min(s_0))
else: print(sum(s))
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
ans = []
for i in range(n):
  ans.append(int(input()))
nm = 0
for i in ans:
  if i %10 != 0:
    nm = i
    print(i)
    break
if sum(ans) % 10 != 0:
  print(sum(ans))
elif nm !=0:
  print(sum(ans)-i)
else:
  print(0)

Failing test case input:
3
5
10
8

Expected output:
23


Actual output:
5
23


Fixed submission (verdict: Accepted):
n = int(input())
ans = []
for i in range(n):
  ans.append(int(input()))
nm = 0
ans.sort()
for i in ans:
  if i %10 != 0:
    nm = i
    break
if sum(ans) % 10 != 0:
  print(sum(ans))
elif nm !=0:
  print(sum(ans)-i)
else:
  print(0)

Problem: p03699
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):

N = int(input())
s = []
for i in range(N):
    s.append(int(input()))

sei=0
s = sorted(s)
total = sum(s)
flg=0

if total%10!=0:
    out=total
    flg=1
else:
    scr=total
    for i in range(N):
        if s[i] %10!=0:
            print(sum(s)-s[i])
            break
        elif i==N-1:
            print(0)
            break

Failing test case input:
3
-101
-1
0

Expected output:
-102


Actual output:

Fixed submission (verdict: Accepted):

N = int(input())
s = []
for i in range(N):
    s.append(int(input()))

s = sorted(s)
total = sum(s)

if total%10!=0:
    out=total
    print(out)
else:
    scr=total
    for i in range(N):
        if s[i] %10!=0:
            print(sum(s)-s[i])
            break
        elif i==N-1:
            print(0)
            break

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
ans = sum(s)
i = 0
if ans%10 == 0:
    for c in s:
        if c%10 != 0:
            ans-=c
            break
print(ans)


Failing test case input:
3
10
20
40

Expected output:
0


Actual output:
70


Fixed submission (verdict: Accepted):
n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
ans = sum(s)
i = 0
if ans%10 == 0:
    for c in s:
        if c%10 != 0:
            ans-=c
            break

if ans%10 == 0:
    ans = 0    
print(ans)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


def main(N, S):
    total = sum(S)
    if total % 10 != 0:
        return 0
    victim = sorted(x for x in S if x % 10 != 0)
    if len(victim) == 0:
        return 0
    else:
        return total - victim[0]

N = int(input())
S = [None] * N
for i in range(N):
    S[i] = int(input())
print(main(N, S))


Failing test case input:
3
-11
1
4

Expected output:
-6


Actual output:
0


Fixed submission (verdict: Accepted):


def main(N, S):
    total = sum(S)
    if total % 10 != 0:
        return total
    victim = sorted(x for x in S if x % 10 != 0)
    if len(victim) == 0:
        return 0
    else:
        return total - victim[0]

N = int(input())
S = [None] * N
for i in range(N):
    S[i] = int(input())
print(main(N, S))
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
numbers = []
score = 0

for _ in range(n):
	a = int(input())
	score += a
	numbers.append(a)
numbers.sort()
print(numbers)

for i in numbers:
	if score % 10 == 0:
		score -= i
	else:
		break

print(score)

Failing test case input:
3
0
0
3

Expected output:
3


Actual output:
[0, 0, 3]
3


Fixed submission (verdict: Accepted):
n = int(input())
numbers = list(map(int, [input() for _ in range(n)]))
numbers.sort()
score = sum(numbers)

if score % 10 == 0:
	for i in numbers:
		if i % 10 == 0:
			pass
		else:
			score -= i
			break

if score % 10 == 0:
	print(0)
else:
	print(score)

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
S = []

for i in range(N):
  S.append(int(input()))
  
S.sort(reverse = True)

ans = sum(S)

for i in range(N):
  if ans % 10 == 0:
    ans -= S[i]
    
  else:
    print(ans)


Failing test case input:
3
-25
4
0

Expected output:
-21


Actual output:
-21
-21
-21


Fixed submission (verdict: Accepted):
N = int(input())
S = []

for i in range(N):
  S.append(int(input()))
  
S.sort()
ans = sum(S)

if ans % 10 != 0:
  print(ans)
  exit()
  
for i in range(N):
  if S[i] % 10 != 0:
    ans -= S[i]
    print(ans)
    exit()

print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = []

for i in range(N):
    s = int(input())
    S.append(s)

a = sum(S)
ans = 0

if a % 10 != 0:
    print(a)
else:
    T = [s for s in S if s%10!=0]
    if len(T) == 0:
       ans = 0
    else:
        ans = a-min(T)

print(ans)

Failing test case input:
3
0
-38
1

Expected output:
-37


Actual output:
-37
0


Fixed submission (verdict: Accepted):
N = int(input())
S = []

for i in range(N):
    s = int(input())
    S.append(s)

a = sum(S)
ans = 0

if a % 10 != 0:
    ans = a
else:
    T = [s for s in S if s%10!=0]
    if len(T) == 0:
       ans = 0
    else:
        ans = a-min(T)

print(ans)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
li = [0]
for i in range(n):li.append(int(input()))
li.sort(reverse=True)
if sum(li) % 10 == 0:
    for k in range(n+1):
        if (sum(li)-li[k]) % 10 != 0:
            print(sum(li))
            exit()
else:
    print(sum)
    exit()
print("0")

Failing test case input:
3
33
1
1

Expected output:
35


Actual output:
<built-in function sum>


Fixed submission (verdict: Accepted):
n = int(input())
li = []
for i in range(n):li.append(int(input()))
li.sort()
if sum(li) % 10 == 0:
    for k in range(n):
        if (sum(li)-li[k]) % 10 != 0:
            print(sum(li)-li[k])
            exit()
else:
    print(sum(li))
    exit()
print("0")
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


def main(N, S):
    total = sum(S)
    if total % 10 != 0:
        return 0
    victim = sorted(x for x in S if x % 10 != 0)
    if len(victim) == 0:
        return 0
    else:
        return total - victim[0]

N = int(input())
S = [None] * N
for i in range(N):
    S[i] = int(input())
main(N, S)


Failing test case input:
3
-166
-4
-1

Expected output:
-171


Actual output:

Fixed submission (verdict: Accepted):


def main(N, S):
    total = sum(S)
    if total % 10 != 0:
        return total
    victim = sorted(x for x in S if x % 10 != 0)
    if len(victim) == 0:
        return 0
    else:
        return total - victim[0]

N = int(input())
S = [None] * N
for i in range(N):
    S[i] = int(input())
print(main(N, S))

Problem: p03699
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())

s_L = []
for i in range(n):
    s_L.append(int(input()))

ans = sum(s_L)
if ans % 10 != 0:
    print(ans)

s_L = sorted(s_L)

for i in range(n):
    if s_L[i]%10 != 0:
        print(ans-s_L[i])
        exit()

print(0)

Failing test case input:
3
2
3
1

Expected output:
6


Actual output:
6
5


Fixed submission (verdict: Accepted):
n = int(input())

s_L = []
for i in range(n):
    s_L.append(int(input()))

ans = sum(s_L)
if ans % 10 != 0:
    print(ans)
    exit()

s_L = sorted(s_L)

for i in range(n):
    if s_L[i]%10 != 0:
        print(ans-s_L[i])
        exit()

print(0)

Problem: p03699
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import itertools

N=int(input())
A=[0]*N
for i in range(N):
    A[i]=int(input())

m=sum(A)

if(m%10==0):
    A=sorted(A)
    for a in A:
        if a%10!=0:
            print(m-a)
            exit()

else:
    print(m)



Failing test case input:
3
10
20
40

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
import itertools

N=int(input())
A=[0]*N
for i in range(N):
    A[i]=int(input())

m=sum(A)

if(m%10==0):
    A=sorted(A)
    for a in A:
        if a%10!=0:
            print(m-a)
            exit()
    print(0)
else:
    print(m)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
S = []
for _ in range(n):
    S.append(int(input()))

min_not_ten = 1000
for i in range(n):
    if S[i] <= min_not_ten and S[i] % 10 != 0:
        min_not_ten = S[i]
if min_not_ten == 1000:
    min_not_ten = 0

ans = sum(S) - min_not_ten
if ans % 10 == 0:
    ans = 0
print(ans)



Failing test case input:
3
-14
1
2

Expected output:
-11


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
S = []
for _ in range(n):
    S.append(int(input()))

min_not_ten = 1000
for i in range(n):
    if S[i] <= min_not_ten and S[i] % 10 != 0:
        min_not_ten = S[i]
if min_not_ten == 1000:
    min_not_ten = 0

if sum(S) % 10 != 0:
    ans = sum(S)
elif min_not_ten == 0:
    ans = 0
else:
    ans = sum(S) - min_not_ten

print(ans)
Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys

N=int(input())
s=[int(input()) for i in range(N)]
num=sum(s)

if num%10!=0:
    print(num)
else:
    for i in range(N):
        s=sorted(s)
        if s[i]%10==0:
            continue
        else:
            print(num-s[i])
            sys.exit()

if len(s)==0:
    print(0)

Failing test case input:
3
10
20
30

Expected output:
0

Actual output:

Fixed submission (verdict: Accepted):
import sys
N=int(input())
s=[int(input()) for i in range(N)]
num=sum(s)

if num%10!=0:
    print(num)
else:
    for i in range(N):
        s=sorted(s)
        if s[i]%10==0:
            continue
        else:
            print(num-s[i])
            sys.exit()
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = [int(input()) for i in range(N)]

ans = sum(S)

S.sort()

for s in S:
  if ans%10 == 0 and s%10 != 0:
    ans = ans - s
    break
  else:
    break

if ans%10 != 0:
  print(ans)
else:
  print(0)


Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = [int(input()) for i in range(N)]

ans = sum(S)
S.sort()

for s in S:
  if ans%10 == 0 and s%10 != 0:
    ans = ans - s
    break

if ans%10 != 0:
  print(ans)
else:
  print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = []
for i in range(N):
    ss = int(input())
    s.append(ss)
ssum = sum(s)
s = sorted(s)
for val in s:
    if ssum % 10 == 0:
        if val % 10 != 0:
            ssum -= val
    else:
        break
if ssum == sum(s):
    print(0)
else:
    print(ssum)

Failing test case input:
3
60
1
2

Expected output:
63


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
s = []
for i in range(N):
    ss = int(input())
    s.append(ss)
ssum = sum(s)
s = sorted(s)
for val in s:
    if ssum % 10 == 0:
        if val % 10 != 0:
            ssum -= val
    else:
        break
if ssum == sum(s) and ssum % 10 == 0 :
    print(0)
else:
    print(ssum)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
ans=0

for i in range(a):
	if b[i]%10!=0 and sum(b)%10==0:
		ans=sum(b)-b[i]
		break
print(ans)

Failing test case input:
3
-1
0
3

Expected output:
2


Actual output:
0


Fixed submission (verdict: Accepted):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
ans=sum(b)
d=0
for i in range(a):
	if b[i]%10!=0 and sum(b)%10==0 :
		ans=sum(b)-b[i]
		d=1
		break
if d==1 or ans%10!=0:
	print(ans)
else:
	print(0)
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
total=0
mini=101
for i in range(n):
    s=int(input())
    total+=s
    if s<mini:
        mini=s
if total%10!=0:
    print(total)
else:
    if mini%10!=0:
        print(total-mini)
    else:
        print(0)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
total=0
mini=101
check=0
for i in range(n):
    s=int(input())
    total+=s
    if s%10!=0 and s<mini:
        mini=s
        check=1
if total%10!=0:
    print(total)
else:
    if check==1:
        print(total-mini)
    else:
        print(0)

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
s = [int(input()) for _ in range(n)]

ans = sum(s)
x = []

for i in s:
    if i % 10 != 0:
        x.append(i)
x = sorted(x)

for i in x:
    if ans % 10 == 0:
        ans = ans - i
print(ans)

Failing test case input:
3
10
20
30

Expected output:
0

Actual output:
60


Fixed submission (verdict: Accepted):
n = int(input())
s = [int(input()) for _ in range(n)]

ans = sum(s)
x = []

for i in s:
    if i % 10 != 0:
        x.append(i)
x = sorted(x)

for i in x:
    if ans % 10 == 0:
        ans = ans - i
if ans % 10 == 0:
    print(0)
else:
    print(ans)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = sorted(int(input()) for _ in range(n))
ans = sum(a)
if ans % 10 != 0:
    print(ans)
    exit()
for i in a:
    if ans-i % 10 != 0:
        print(ans-i)
        exit()
else:print(0)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
10


Fixed submission (verdict: Accepted):
n = int(input())
a = sorted(int(input()) for _ in range(n))
ans = sum(a)
if ans % 10 != 0:
    print(ans)
    exit()
else:
    for i in a:
        if (ans-i) % 10 != 0:
            print(ans-i)
            exit()
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = []
for i in range(N):
    S.append(int(input()))
S.append(0)
Sum = sum(S)
S.sort()

for i in range(len(S)):
    if (Sum-S[i])%10!=0:
        break
    else:
        Sum -=S[i]
print(Sum)
        

Failing test case input:
3
-58
-1
1

Expected output:
-58


Actual output:
0


Fixed submission (verdict: Accepted):
N = int(input())
S = []
for i in range(N):
    S.append(int(input()))

Sum = sum(S)
S.sort()

for i in range(len(S)):
    if (Sum)%10!=0:
        print(Sum)
        exit()
    else:
        if S[i]%10!=0:
            Sum -=S[i]
print(0)
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a =[]
for i in range(n):
    a.append(int(input()))

a.sort(reverse=True)
s=sum(a)
if s%10==0:
    for i in a:
        if i%10>0:
            s-=i
            break
if s%10>0:
    print(s)
else:
    print(0)



Failing test case input:
3
-4
2
22

Expected output:
24


Actual output:
-2


Fixed submission (verdict: Accepted):
n=int(input())
a =[]
for i in range(n):
    a.append(int(input()))
 
a.sort()
s=sum(a)
if s%10==0:
    for i in a:
        if i%10>0:
            s-=i
            break
if s%10>0:
    print(s)
else:
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = [int(input()) for _ in range(N)]
S = sorted(s)
Res = sum(s)

if Res % 10 == 0:
    for i in s:
        if (Res - i) % 10 != 0:
            Res -= i
            break

print(Res)

Failing test case input:
3
10
20
30

Expected output:
0

Actual output:
60


Fixed submission (verdict: Accepted):
N = int(input())
s = [int(input()) for _ in range(N)]
S = sorted(s)
Res = sum(s)
flag = False

if Res % 10 == 0:
    for i in S:
        if (Res - i) % 10 != 0:
            Res -= i
            flag = True
            break
else:
    flag = True

print(Res if flag else 0)

Problem: p03699
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())
s_min = 100
score = 0

for _ in range(N):
    tmp = int(input())
    score += tmp
    s_min = min(s_min, tmp)

print(score - s_min if score % 10 == 0 else score)

Failing test case input:
3
10
20
40

Expected output:
0


Actual output:
60


Fixed submission (verdict: Accepted):
N = int(input())
s_min = 100
score = 0
all_10 = True

for _ in range(N):
    tmp = int(input())
    score += tmp
    if tmp % 10 != 0:
        s_min = min(s_min, tmp)
        all_10 = False

if all_10:
    print(0)
else:
    print(score - s_min if score % 10 == 0 else score)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = []
for i in range(N):
    S.append(int(input()))
S.append(0)
Sum = sum(S)
S.sort()

for i in range(len(S)):
    if (Sum-S[i])%10!=0:
        print(Sum-S[i])
        exit()


Failing test case input:
3
-26
0
-1

Expected output:
-27


Actual output:
-1


Fixed submission (verdict: Accepted):
N = int(input())
S = []
for i in range(N):
    S.append(int(input()))

Sum = sum(S)
S.sort()

for i in range(len(S)):
    if (Sum)%10!=0:
        print(Sum)
        exit()
    else:
        if S[i]%10!=0:
            Sum -=S[i]
print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = [int(input()) for _ in range(n)]

a.sort()

suma = sum(a)

if suma % 10 != 0:
  print(suma)
else:
  for i in a:
    if i % 10 != 0:
      print(suma - i)
      exit()
print(0)


Failing test case input:
3
8
10
15

Expected output:
33


Actual output:
33
0


Fixed submission (verdict: Accepted):
n = int(input())
a = [int(input()) for _ in range(n)]

a.sort()

suma = sum(a)

if suma % 10 != 0:
  print(suma)
  exit()
else:
  for i in a:
    if i % 10 != 0:
      print(suma - i)
      exit()
print(0)
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(int(input()) for i in range(n))
a.sort()
b = sum(a)

c = b

for i in range(n) :
  if c % 10 == 0 :
    c = b - a[i]
  else :
    break

print (c)


Failing test case input:
3
10
20
30

Expected output:
0

Actual output:
30


Fixed submission (verdict: Accepted):
n = int(input())
a = list(int(input()) for i in range(n))
a.sort()
b = sum(a)

c = b

for j in range(100) :
  for i in range(n) :
    if c % 10 == 0 :
      c = b - a[i]
      if c == 0 :
        break
    else :
      break
  b = b - a[i]
  n = n - 1

print (c)

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    s = [int(input()) for _ in range(n)]
    for i in range(n**2):
        tmp = 0
        for j in range(n):
            if i>>j&1:
                tmp += s[j]
        if tmp%10 != 0:
            ans = max(ans, tmp)
    print(ans)

if __name__ == '__main__':
    main()

Failing test case input:
3
-1
16
1

Expected output:
16


Actual output:
17


Fixed submission (verdict: Accepted):
import sys

input = sys.stdin.readline

def main():
    ans = 0
    n = int(input())
    s = []   
    for i in range(n):
        t = int(input())
        ans += t
        s.append(t)
    s.sort()
    
    if ans%10 == 0:
        for i in range(n):
            if s[i]%10 != 0:
                ans -= s[i]
                break
    if ans%10 == 0:
      ans = 0
    print(ans)

if __name__ == '__main__':
    main()

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
s = []
for i in range(N):
  s.append(int(input()))

s.sort()
ans = sum(s)
if ans % 10 == 0:
  fil = list(filter(lambda x: x % 10 != 0, s))
  if len(fil) == 0:
    print(0)
  else:
    print(ans - s[0])
else:
  print(ans)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
10


Fixed submission (verdict: Accepted):
N = int(input())
s = []
for i in range(N):
  s.append(int(input()))

s.sort()
ans = sum(s)
if ans % 10 == 0:
  fil = list(filter(lambda x: x % 10 != 0, s))
  if len(fil) == 0:
    print(0)
  else:
    print(ans - fil[0])
else:
  print(ans)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = [int(input()) for _ in range(N)]
sumS = sum(S)
T = list(filter(lambda x : x%10!=0, S))
T.sort()
for t in T:
    if sumS%10!=0:
        break
    else:
        sumS -= t
print(sumS)

Failing test case input:
3
10
20
40

Expected output:
0


Actual output:
70


Fixed submission (verdict: Accepted):
N = int(input())
S = [int(input()) for _ in range(N)]
sumS = sum(S)
T = list(filter(lambda x : x%10!=0, S))
T.sort()
if len(T)==0:
    print(0)
else:
    for t in T:
        if sumS%10!=0:
            break
        else:
            sumS -= t
    print(sumS)
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
s = []
for i in range(n):
  s.append(int(input()))
 
ss = sum(s)
if ss % 10 == 0:
  
  s.sort()
  m = [t for t in s if t%10!=0]
  if len(m) == 0:
    print(0)
  else:
    print(ss-min(m))

Failing test case input:
3
-18
4
1

Expected output:
-13


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
s = []
for i in range(n):
  s.append(int(input()))
 
ss = sum(s)
if ss % 10 == 0:
  
  s.sort()
  m = [t for t in s if t%10!=0]
  if len(m) == 0:
    print(0)
  else:
    print(ss-min(m))
else:
  print(ss)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
lis = []
all10 = True
res = 0
for _ in range(N):
    tmp = int(input())
    res += tmp
    lis.append(tmp)
    if all10 and tmp % 10 != 0:
        all10 = False

if all10:
    print(0)
    exit()
if res % 10 != 0:
    print(res)
    exit()
else:
    lis.sort()
    for i in lis:
        if i % 10 != 0:
            print(res-i)


Failing test case input:
3
1
8
1

Expected output:
9


Actual output:
9
9
2


Fixed submission (verdict: Accepted):
N = int(input())
lis = []
all10 = True
res = 0
for _ in range(N):
    tmp = int(input())
    res += tmp
    lis.append(tmp)
    if all10 and tmp % 10 != 0:
        all10 = False

if all10:
    print(0)
    exit()
if res % 10 != 0:
    print(res)
    exit()
else:
    lis.sort()
    for i in lis:
        if i % 10 != 0:
            print(res-i)
            exit()

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
S = sorted(list(map(int, input().split())))
sumS = sum(S)
if sumS%10:
  print(sumS)
else:
  for i in S:
    if i%10:
      print(sumS - i)
      exit()
  print(0)

Failing test case input:
3
-260
0
-1

Expected output:
-261


Actual output:
0


Fixed submission (verdict: Accepted):
n = int(input())
S = sorted([ int(input()) for _ in range(n) ])
sumS = sum(S)
if sumS%10:
  print(sumS)
else:
  for i in S:
    if i%10:
      print(sumS - i)
      exit()
  print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
S=[]
for i in range(N):
    s=int(input())
    S.append(s)
S.sort()
wa=sum(S)
wa1=sum(S)


for i in range(N):
    if wa%10!=0:
        print(wa)
        break
    if wa1%10!=0:
        print(wa)
    if i==N-1:
        print(0)    
    else:
        wa=wa-S[i]
        wa1=wa-S[i+1]
        if wa==wa1:
            wa1=wa-S[i+2]

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
10
8


Fixed submission (verdict: Accepted):
N=int(input())
S=[]
for i in range(N):
    s=int(input())
    S.append(s)
S.sort()
wa=sum(S)


for i in range(N):
    if wa%10!=0:
        print(wa)
        break
    if i==N-1:
        print(0)
        break
    if S[i]%10==0:
        for j in range(i,N):
            if S[j]%10!=0:
               minus=S[j] 
               wa=wa-minus
               break
        continue
    wa=wa-S[i]
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
res = sum(s)
for i in range(n):
    if res%10==0:
        res -= s[i]
    else:
        print(res)
        exit()

Failing test case input:
3
10
20
40

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
n = int(input())
s = [int(input()) for _ in range(n)]
s.sort()
res = sum(s)
for i in range(n):
    if res%10==0:
        if s[i]%10!=0:
            res -= s[i]
    else:
        print(res)
        exit()
print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))
S.sort()
ans = sum(S)
if ans % 10 != 0:
    print(ans)
    sys.exit()
for i in S:
    if i % 10 != 0:
        ans -= i
        print(ans)
        break

Failing test case input:
3
10
20
30

Expected output:
0

Actual output:

Fixed submission (verdict: Accepted):
import sys
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))
S.sort()
ans = sum(S)
if ans % 10 != 0:
    print(ans)
    sys.exit()
for i in S:
    if i % 10 != 0:
        ans -= i
        print(ans)
        sys.exit()
print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s = [int(input()) for _ in range(N)]
s.sort()
ans = sum(s)

if ans % 10 != 0:
  print(ans)
else:
  for i in range(N):
    if s[i] % 10 != 0:
      print(ans - s[i])
      exit()


Failing test case input:
3
10
20
40

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
N = int(input())
s = [int(input()) for _ in range(N)]
s.sort()
ans = sum(s)

if ans % 10 != 0:
  print(ans)
else:
  for i in range(N):
    if s[i] % 10 != 0:
      print(ans - s[i])
      exit()
  print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
L=sorted([int(input()) for i in range(n)])
S=sum(L)
if S%10!=0:
    print(S)
else:
    for i in range(n):
        if (S-L[i])%10!=0:
            print(S-L[i])
            exit()
        else:
            print(0)
            exit()

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
0


Fixed submission (verdict: Accepted):
n=int(input())
L=sorted([int(input()) for i in range(n)])
S=sum(L)
if S%10!=0:
    print(S)
    exit()
else:
    for i in range(n):
        if (S-L[i])%10!=0:
            print(S-L[i])
            exit()
print(0)
Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
g = int(input())

grades = []
for i in range(g):
    grade = int(input())
    grades.append(grade)

total = sum(grades)
grades.sort()
grades = [0] + grades
for grade in grades:
    if (total - grade) % 10 != 0:
        print(total - grade)
        break


    
print(0)


Failing test case input:
3
-14
1
2

Expected output:
-11


Actual output:
-11
0


Fixed submission (verdict: Accepted):
g = int(input())

grades = []
for i in range(g):
    grade = int(input())
    grades.append(grade)

total = sum(grades)
grades.sort()
grades = [0] + grades
count = 0
for grade in grades:
    if (total - grade) % 10 != 0:
        print(total - grade)
        break
    else:
        count += 1

if count == len(grades):
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
ans=sum(b)
d=0
for i in range(a):
	if b[i]%10!=0 and sum(b)%10==0 :
		ans=sum(b)-b[i]
		d=1
		break
if d==1:
	print(ans)
else:
	print(0)

Failing test case input:
3
-34
1
0

Expected output:
-33


Actual output:
0


Fixed submission (verdict: Accepted):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
ans=sum(b)
d=0
for i in range(a):
	if b[i]%10!=0 and sum(b)%10==0 :
		ans=sum(b)-b[i]
		d=1
		break
if d==1 or ans%10!=0:
	print(ans)
else:
	print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))
S.sort()
for s in S:
    if s != 10:
        print(sum(S) - s)
        break
else:
    print(0)

Failing test case input:
3
33
1
1

Expected output:
35


Actual output:
34


Fixed submission (verdict: Accepted):
N = int(input())
S = []
for _ in range(N):
    S.append(int(input()))
sums = sum(S)
if sums % 10 != 0:
    print(sums)
else:
    S.sort()
    for s in S:
        if s % 10 != 0:
            print(sums - s)
            break
    else:
        print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=sorted([int(input()) for _ in range(n)])
sum_s=sum(s)
if sum_s%10!=0:
    print(sum_s)
else:
    for i in s:
        if i %10!=0:
            print(sum_s-i)
            exit()
print(0)


Failing test case input:
3
-166
-1
-1

Expected output:
-168


Actual output:
-168
0


Fixed submission (verdict: Accepted):
n=int(input())
s=sorted([int(input()) for _ in range(n)])
sum_s=sum(s)
if sum_s%10!=0:
    print(sum_s)
else:
    for i in s:
        if i %10!=0:
            print(sum_s-i)
            exit()
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import sys

n=int(input())
a=[int(input())for _ in range(n)]
a.sort()
ans=0

if sum(a)%10==0:
  for i in a:
    if i%10!=0:
      print(sum(a)-i)
      sys.exit()
      
else:
  print(sum(a))

Failing test case input:
3
10
20
30

Expected output:
0

Actual output:

Fixed submission (verdict: Accepted):
import sys

n=int(input())
a=[int(input())for _ in range(n)]
a.sort()
ans=0

if sum(a)%10==0:
  for i in a:
    if i%10!=0:
      print(sum(a)-i)
      sys.exit()
  print(0)
      
else:
  print(sum(a))
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
s=list(map(int,[input() for i in range(n)]))
a=sum(s)
if a%10!=0:
  print(a)
else:
  s.sort()
  for i in s:
    if i%10!=0:
      a-=i
      print(a)
      break
    print(0)

Failing test case input:
3
10
20
40

Expected output:
0


Actual output:
0
0
0


Fixed submission (verdict: Accepted):
import sys
n=int(input())
s=list(map(int,[input() for i in range(n)]))
a=sum(s)
if a%10!=0:
  print(a)
else:
  s.sort()
  for i in s:
    if i%10!=0:
      a-=i
      print(a)
      sys.exit()
  print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
s_list = []
for i in range(N):
    s_list.append(int(input()))

sum_num = sum(s_list)

if sum_num % 10 != 0:
    print(sum_num)
    exit()
else:
    s_list.sort()
    tmp = sum_num
    for s in s_list:
        sum_num = tmp - s
        if sum_num % 10 != 0:
            print(sum_num)
            exit()
    print(sum_num)

Failing test case input:
3
10
20
30

Expected output:
0

Actual output:
30


Fixed submission (verdict: Accepted):
N = int(input())
s_list = []
for i in range(N):
    s_list.append(int(input()))

sum_num = sum(s_list)

if sum_num % 10 != 0:
    print(sum_num)
    exit()
else:
    s_list.sort()
    tmp = sum_num
    for s in s_list:
        if s % 10 == 0:
            continue
        sum_num = tmp - s
        if sum_num % 10 != 0:
            print(sum_num)
            exit()
        sum_num = tmp
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
List = []
for _ in range(n):
  x = int(input())
  List.append(x)
List = sorted(List)
Total = sum(List)

while Total %10 ==0:
  for item in List:
    if item %10 !=0:
      Total -= item
    List.remove(item)
    if Total %10!= 0:
      break
  if Total %10 == 0:
    Total = 0
  break
print(Total)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
List = []
for _ in range(n):
  x = int(input())
  List.append(x)
List = sorted(List)
Total = sum(List)

if Total % 10 ==0:
  for item in List:
    if item %10 !=0:
      Total -= item
      break
if Total % 10 == 0:
  Total = 0
print(Total)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
numbers = list(map(int, [input() for _ in range(n)]))
numbers.sort()
score = sum(numbers)

if score % 10 == 0:
	for i in numbers:
		if i % 10 == 0:
			pass
		else:
			score -= i
			break

print(score)

Failing test case input:
3
10
20
30

Expected output:
0

Actual output:
60


Fixed submission (verdict: Accepted):
n = int(input())
numbers = list(map(int, [input() for _ in range(n)]))
numbers.sort()
score = sum(numbers)

if score % 10 == 0:
	for i in numbers:
		if i % 10 == 0:
			pass
		else:
			score -= i
			break

if score % 10 == 0:
	print(0)
else:
	print(score)
Problem: p03699
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
import sys
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
m = sum(s)
if  m % 10 != 0:
  print(m)

else:
  for i in range(n):
    m -= s[i]
    if m % 10 != 0:
      print(m)
      sys.exit()
print(0)  



Failing test case input:
3
-38
1
2

Expected output:
-35


Actual output:
-35
0


Fixed submission (verdict: Accepted):
import sys
n = int(input())
s = [int(input()) for i in range(n)]
s.sort()
m = sum(s)
if  m % 10 != 0:
  print(m)
else:
  for i in range(n):
    if s[i] % 10 != 0:
      m -= s[i]
      print(m)
      sys.exit()
  print(0)

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
if c%10!=0:
  print(c)
else:
  for k in range(a):
    c=c-b[k]
    if c%10!=0:
      print(c)
      break

Failing test case input:
3
10
20
40

Expected output:
0


Actual output:

Fixed submission (verdict: Accepted):
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
c=sum(b)
d=0
if c%10!=0:
  print(c)
else:
  for i in range(a):
    if b[i]%10!=0:
      c=c-b[i]
      print(c)
      break
  if sum(b)==c:
    print(0)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
l=[]
s=0
for i in range(n):
  a=int(input())
  s+=a
  if a%10!=0:
    l.append(a)
if len(l)==0:
  print(0)
else:
  print(s-min(l))
  

           

Failing test case input:
3
7
20
40

Expected output:
67


Actual output:
60


Fixed submission (verdict: Accepted):
n=int(input())
l=[]
s=0
for i in range(n):
  a=int(input())
  s+=a
  if a%10!=0:
    l.append(a)
if len(l)==0:
  print(0)
else:
  if s%10==0:
    print(s-min(l))
  else:
    print(s)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

s = [int(input()) for x in range(N)]

fullmax = sum(s)
s_sorted = sorted(s)

cur_max = 0

if fullmax % 10 != 0 :
    print(fullmax)
else :
    
    div_flg = True
    for i in s :
        if i % 10 != 0 :
            div_flg = False
            
    if div_flg == True :
        print("0")
    else :
        for i in range(N - 1) :
            if fullmax - s_sorted[i] % 10 != 0 :
                cur_max = max(fullmax - s_sorted[i], cur_max)
        
        print(cur_max)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
10


Fixed submission (verdict: Accepted):
N = int(input())

s = [int(input()) for x in range(N)]

fullmax = sum(s)
s_sorted = sorted(s)

cur_max = 0

if fullmax % 10 != 0 :
    print(fullmax)
else :
    
    div_flg = True
    for i in s :
        if i % 10 != 0 :
            div_flg = False
            
    if div_flg == True :
        print("0")
    else :
        for i in range(N) :
            if (fullmax - s_sorted[i]) % 10 != 0 :
                cur_max = max(fullmax - s_sorted[i], cur_max)
        
        print(cur_max)
Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import sys
import os

N = int(input())
A = []
for i in range(N):
    a = int(input())
    A.append(a)
A.sort()

if sum(A) % 10 != 0:
    print(sum(A))
else:
    for i in range(N):
        if A[i] % 10 != 0:
            print(sum(A) - A[i])
            exit()
print(0)

Failing test case input:
3
-166
-1
-1

Expected output:
-168


Actual output:
-168
0


Fixed submission (verdict: Accepted):


import sys
import os

N = int(input())
A = []
is_all_ten = True
for i in range(N):
    a = int(input())
    if a % 10 != 0:
        is_all_ten = False
    A.append(a)
A.sort()

if is_all_ten:
    print(0)
elif sum(A) % 10 != 0:
    print(sum(A))
else:
    not_ten_list = [x for x in A if x % 10 != 0]
    print(sum(A) - not_ten_list[0])

Problem: p03699
Buggy submission (Python (3.8.2), verdict: Wrong Answer):




n = int(input())


s = []
for i in range(n):
    s.append(int(input()))



tensu = sum(s)

s2 = sorted(s)

tensu_ans = 0

if tensu % 10 == 0:
    if all([True if s % 10 == 0 else False for s in s2]):
        tensu_ans = 0
    else:
        tensu_ans = tensu - s2[0]
else:
    tensu_ans = tensu

print(tensu_ans)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
10


Fixed submission (verdict: Accepted):




n = int(input())


s = []
for i in range(n):
    s.append(int(input()))



tensu = sum(s)

s2 = sorted(s)

tensu_ans = 0

if tensu % 10 == 0:
    if all([True if _s % 10 == 0 else False for _s in s]):
        tensu_ans = 0
    else:
        tensu_ans = tensu - min([_s for _s in s if _s % 10 != 0])
else:
    tensu_ans = tensu

print(tensu_ans)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
List = []
for _ in range(n):
  x = int(input())
  List.append(x)
List = sorted(List)
Total = sum(List)
while Total %10 ==0 and len(List) !=0:
  for item in List:
    if item %10 !=0:
      Total -= item
    List.remove(item)
    if Total %10!= 0:
      break
if Total %10 == 0:
  Total = 0
print(Total)

Failing test case input:
3
2
8
0

Expected output:
8


Actual output:
2


Fixed submission (verdict: Accepted):
n=int(input())
List = []
for _ in range(n):
  x = int(input())
  List.append(x)
List = sorted(List)
Total = sum(List)

if Total % 10 ==0:
  for item in List:
    if item %10 !=0:
      Total -= item
      break
if Total % 10 == 0:
  Total = 0
print(Total)

Problem: p03699
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

a = []
b = []
for i in range(n):
    s = int(input())
    if s%10 == 0:
        a.append(s)
    else:
        b.append(s)

b = sorted(b,reverse = True)
if len(b) == 0:
    print(0)
elif len(b)%2 == 0:
    print(sum(a)+sum(b[:len(b)-1]))
else:
    print(sum(a)+sum(b))

Failing test case input:
3
-166
0
1

Expected output:
-165


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())

l = []
a = []
for i in range(n):
    s = int(input())
    l.append(s)
    if s%10 != 0:
        a.append(s)

S = sum(l)
    
if S%10 != 0:
    print(S)
elif len(a) >= 1:
    print(S-min(a))
else:
    print(0)