ZhenlongDai/ACPR huggingface dataset:
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N):
    if i % 2 == 1:
        if A[i] % 2 == 1:
            ans += 1
print(ans)

Failing test case input:
15
1 10 109 15 87 98 29 161 0 60 44 11 9 14 19

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(1, N+1):
    if i % 2 == 1:
        if A[i-1] % 2 == 1:
            ans += 1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
cnt = 0

for i in range (N):
  if i % 2 != 0:
    if a[i] %2 != 0:
      cnt += 1
      
print(cnt)

Failing test case input:
15
15 5 109 15 171 98 135 87 0 60 44 11 6 14 19

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
cnt = 0

for i in range (N):
  if (i+1) % 2 != 0:
    if a[i] %2 != 0:
      cnt += 1
      
print(cnt)

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

import sys
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from itertools import accumulate

sys.setrecursionlimit(10**6)
INF = 10**12
m = 10**9 + 7

def main():
    N = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        if i % 2 == 1 and a[i] % 2 == 1:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()


Failing test case input:
15
1 3 109 15 87 98 29 258 0 60 44 11 9 14 32

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):

import sys
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right
from itertools import accumulate

sys.setrecursionlimit(10**6)
INF = 10**12
m = 10**9 + 7

def main():
    N = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in range(N):
        if i % 2 == 0 and a[i] % 2 == 1:
            ans += 1
    print(ans)

if __name__ == "__main__":
    main()

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))

c=0

for i in range(0,n):
  if i%2!=0 or a[i]%2!=0:
    c+=1
print(c)

Failing test case input:
15
1 3 109 15 87 98 29 258 0 60 44 11 9 14 32

Expected output:
5


Actual output:
12


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))

c=0

for i in range(0,n):
  if i%2 == 0 and a[i]%2 == 1:
    c+=1
print(c)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    if a[i] % 2 == i % 2 == 1:
        ans += 1
print(ans)

Failing test case input:
5
1 4 4 7 7

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(n):
    if a[i] % 2 == (i+1) % 2 == 1:
        ans += 1
print(ans)
Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
count = 0
for i in range(N):
    if A[i] % 2 != 0 and i%2!=0:
        count += 1
print(count)

Failing test case input:
15
15 5 71 15 50 98 93 87 0 43 44 11 6 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
count = 0
for i in range(N):
    if A[i] % 2 != 0 and (i+1)%2!=0:
        count += 1
print(count)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
in_list = list(map(int,input().split()))
cnt = 0
for i in range(1,n+1):
    if i%2 == 0:
        if in_list[i-1]%2 == 0:
            cnt += 1
    elif i%2 == 1:
        if in_list[i-1]%2 == 1:
            cnt += 1
print(cnt)

Failing test case input:
15
1 3 55 15 000 98 28 78 1 60 9 13 12 13 54

Expected output:
4


Actual output:
7


Fixed submission (verdict: Accepted):
n = int(input())
in_list = list(map(int,input().split()))
cnt = 0
for i in range(1,n+1):
    if i%2 == 1:
        if in_list[i-1]%2 == 1:
            cnt += 1
print(cnt)

Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N=int(input())

a=[0]*N
a=list(map(int,input().split()))
ans=0
for i in range(1,N+5,2):
    if(N-1<i):
        break
    if(a[i]%2==1):
        ans=ans+1
print(ans)


Failing test case input:
15
1 3 55 15 113 98 28 78 1 60 9 11 12 13 32

Expected output:
5


Actual output:
4


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

a=[0]*N
a=list(map(int,input().split()))
ans=0
for i in range(1,N+5,2):
    if(N<i):
        break
    if(a[i-1]%2==1):
        ans=ans+1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(N - 1):
    if (i + 1) % 2 == 1 and a[i + 1] % 2 ==1:
            cnt += 1
    else:
            cnt += 0
print(str(cnt))

Failing test case input:
5
0 5 2 5 7

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(N + 1):
    if i % 2 == 1 and a[i - 1] % 2 ==1:
            cnt += 1
    else:
            cnt += 0
print(str(cnt))

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
lst = list(map(int, input().split()))

c = 0
for i in range(n):
  if i % 2 == 1:
    if lst[i] % 2 == 1:
      c += 1
print(c)


Failing test case input:
15
15 11 46 15 50 98 93 129 31 43 44 11 6 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
lst = list(map(int, input().split()))

c = 0
for i in range(n):
  if i % 2 == 0:
    if lst[i] % 2 == 1:
      c += 1
print(c)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
input()
li = list(map(int, input().split()))
result = 0
for i in range(len(li)):
    if i % 2 == 1:
        if li[i] % 2 == 1:
            result += 1
print(result)


Failing test case input:
15
1 3 55 15 77 98 28 78 1 60 9 13 12 13 32

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
input()
li = list(map(int, input().split()))
result = 0
for i in range(len(li)):
    if (i + 1) % 2 == 1:
        if li[i] % 2 == 1:
            result += 1
print(result)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(len(a)):
    if a[i]%2 != 0 and i%2 != 0: ans+=1
print(ans)

Failing test case input:
15
1 3 109 15 87 98 29 161 0 60 44 11 9 14 32

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(len(a)):
    if a[i]%2 != 0 and (i+1)%2 != 0: ans+=1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
print(sum([int(i)%2 for i in input().split()[::2]]))


Failing test case input:
15
1 3 110 15 000 98 7 78 1 60 9 13 12 13 54

Expected output:
4


Actual output:
1


Fixed submission (verdict: Accepted):
input()
print(sum([int(i)%2 for i in input().split()[::2]]))

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
count=0
for i in range(N):
    if(i%2==1):
        if(a[i]%2==1):
            count+=1
print(count)

Failing test case input:
15
1 3 55 7 77 98 28 78 1 60 9 11 9 13 32

Expected output:
6


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
a1 = [0]
a = a1+list(map(int,input().split()))
count=0
for i in range(1,N+1):
    if(i%2==1):
        if(a[i]%2==1):
            
            count+=1

print(count)

Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n= int(input())
a=list(map(int,input().split()))
cnt=0
for i, A in enumerate(a):
    if i%2==1 and A%2==1:
        cnt+=1
print(cnt)

Failing test case input:
15
15 11 82 15 50 98 93 77 31 43 44 11 6 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
n= int(input())
a=list(map(int,input().split()))
cnt=0
for i, A in enumerate(a):
    if (i+1)%2==1 and A%2==1:
        cnt+=1
print(cnt)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
nombres = [int(x) for x in input().split()]
k = 0
for indexe,nombre in enumerate(nombres):
    if (indexe%2 == 1 and nombre%2 == 1):
        k += 1
print(k)

Failing test case input:
15
1 3 55 15 000 98 7 78 1 60 9 13 12 13 54

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
nombres = [int(x) for x in input().split()]
k = 0
for indexe,nombre in enumerate(nombres):
    if ((indexe + 1)%2 == 1 and nombre%2 == 1):
        k += 1
print(k)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
lst = list(map(int, input().split()))

c = 0
for i in range(n):
  if i % 2 == 1 and lst[i] % 2 == 1:
    c += 1
print(c)

Failing test case input:
15
13 76 46 15 50 70 93 77 31 12 44 90 6 24 14

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
lst = list(map(int, input().split()))

c = 0
for i in range(n):
  if i % 2 == 0:
    if lst[i] % 2 == 1:
      c += 1
print(c)

Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
    import sys
    input = sys.stdin.readline
    
    n = int(input())
    
    
    
    
    
    A = list(map(int, input().split()))
    
    

    cnt = 0
    for i in range(n):
        if i % 2 == 1 and A[i] % 2 == 1:
            cnt += 1

    print(cnt)


resolve()

Failing test case input:
15
1 10 109 15 87 98 29 161 0 60 44 11 9 26 19

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
def resolve():
    import sys
    input = sys.stdin.readline
    
    n = int(input())
    
    
    
    
    
    A = list(map(int, input().split()))
    
    

    cnt = 0
    for i in range(n):
        if (i+1) % 2 == 1 and A[i] % 2 == 1:
            cnt += 1

    print(cnt)


resolve()

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
A=list(map(int,input().strip().split()))
c=0
for i in range(N):
	if i%2!=0 and A[i]%2!=0:
		c+=1
print(c)

Failing test case input:
15
15 11 46 15 50 98 93 87 31 43 44 11 10 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N=int(input())
A=list(map(int,input().strip().split()))
c=0
for i in range(N):
	if (i+1)%2!=0 and A[i]%2!=0:
		c+=1
print(c)

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

import math

N = int(input())

ai = input().split(' ')

num = 0
for i in range(math.floor(N/2)):
    if int(ai[i]) % 2 == 1:
        num += 1

print(num)

Failing test case input:
15
13 76 46 15 54 98 93 77 31 43 84 90 5 24 14

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):

import math

N = int(input())

ai = input().split(' ')

num = 0
for i in range(N):
    if i % 2 == 0:
        if int(ai[i]) % 2 == 1:
            
            
            num += 1

print(num)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,N,2):
    if a[i]%2==1:
        ans+=1
print(ans)

Failing test case input:
15
15 11 46 15 50 98 93 77 31 43 44 90 6 24 14

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(0,N,2):
    if a[i]%2==1:
        ans+=1
print(ans)
Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N=int(input())
li = list(map(int,input().split()))
coun=0
for i,h in enumerate(li):
  if i % 2 == 1 and h % 2 == 1:
    coun+=1
print(coun)

Failing test case input:
15
15 11 46 15 50 98 93 129 41 43 44 11 6 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N=int(input())
li = list(map(int,input().split()))
coun=0
for i,h in enumerate(li):
  if ((i+1) % 2 == 1) and (h % 2 == 1):
    coun+=1
    
print(coun)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
N = list(map(int,input().split()))
del N[::2]
i = 0
ans = [i for i in N if i % 2 == 1]
print(len(ans))

Failing test case input:
15
15 11 82 15 50 98 93 77 31 43 44 11 6 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
N = list(map(int,input().split()))
del N[1::2]
i = 0
ans = [i for i in N if i % 2 != 0]
print(len(ans))

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
q=0
for x in range(n):
	if x%2==1:
		if a[x]%2==1:
			q+=1
print(q)

Failing test case input:
15
1 3 109 15 87 98 29 161 1 60 9 11 9 14 32

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
q=0
for x in range(n):
	if x%2==0:
		if a[x]%2==1:
			q+=1
print(q)

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

N = int(input())
a= list(map(int,input().split()))
ans = 0

for i in range(N):
    if a[i] % 2 !=0 and i % 2 != 0:
        ans += 1
    else:
        pass
print(ans)

Failing test case input:
15
0 5 46 15 50 98 93 87 31 43 44 11 6 24 14

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):

N = int(input())
a= list(map(int,input().split()))
ans = 0

for i in range(N):
    if a[i] % 2 == 1 and (i+1) % 2 == 1:
        ans += 1
    else:
        pass
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i %2 == 0:
        continue
    if A[i] % 2 == 1:
        ans += 1
print(ans)

Failing test case input:
15
1 3 55 15 77 98 28 78 1 60 9 13 12 13 32

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i %2 == 1:
        continue
    if A[i] % 2 == 1:
        ans += 1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
C = 0
for i in range(1, len(a), 2):
    if a[i] % 2 == 1:
        C += 1
print(C)

Failing test case input:
15
1 10 109 15 87 98 29 161 0 60 86 11 9 14 32

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
C = 0
for i in range(0, len(a), 2):
    if a[i] % 2 == 1:
        C += 1
print(C)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=lmp()
ans=0
for i in range(n):
    if i%2==1 and a[i]%2==1:
        ans+=1
print(ans)

Failing test case input:
15
15 5 71 15 87 98 135 87 0 60 44 17 6 14 19

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=lmp()
ans=0
for i in range(n):
    if i%2==0 and a[i]%2==1:
        ans+=1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in a:
        if i+1 % 2 == 1 and a[i] % 2 == 1:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()


Failing test case input:
15
15 5 71 15 87 98 135 87 0 60 44 11 6 14 19

Expected output:
5


Actual output:
1


Fixed submission (verdict: Accepted):
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0
    for i in range(n):
        if (i+1) % 2 == 1 and a[i] % 2 == 1:
            ans += 1
    print(ans)
    return 0

if __name__ == "__main__":
    solve()

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
a = list(map(int, input().strip().split()))
ans=0
i=0
for _ in range(N):
  if(i % 2 == 1 and a[i] % 2 == 1):
  	ans+=1
  i+=1
print(ans)

Failing test case input:
15
1 3 109 15 77 98 29 78 1 60 9 11 9 13 32

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
N=int(input())
a = list(map(int, input().strip().split()))
ans=0
i=0
for _ in range(N):
  if((i+1)% 2 == 1 and a[i] % 2 == 1):
  	ans+=1
  i+=1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
ans=0
for i in range(1,len(a),2):
  if(a[i]%2):
    ans+=1
print(ans)
  

Failing test case input:
15
15 5 71 15 87 98 135 87 0 60 44 17 6 14 19

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int,input().split()))
ans=0
for i in range(0,len(a),2):
  if(a[i]%2!=0):
    ans+=1
print(ans)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
aa = list(map(int, input().split()))
ans = 0
for i in range(n):
    if i % 2 == 1 and aa[i] % 2 == 1:
        ans += 1
print(ans)


Failing test case input:
15
15 5 71 15 87 98 135 87 0 60 44 17 6 14 19

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
aa = list(map(int, input().split()))
ans = 0
for i in range(n):
    if i % 2 == 0 and aa[i] % 2 == 1:
        ans += 1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
print(len([i for i, ai in enumerate(a) if i%2 and ai%2]))


Failing test case input:
15
0 5 46 15 50 98 93 87 31 43 44 11 6 24 14

Expected output:
2


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
print(len([i for i, ai in enumerate(a) if i%2==0 and ai%2]))

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    _ = readint()
    a = list(readnums())
    ans = 0
    for i, v in enumerate(a):
        if i % 2 and v % 2:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()


Failing test case input:
15
15 11 64 15 50 98 93 77 31 43 44 90 6 24 14

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    _ = readint()
    a = list(readnums())
    ans = 0
    for i, v in enumerate(a):
        if (i + 1) % 2 and v % 2:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

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




def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = 0

    for i in range(N):
        if i % 2 != 0 and A[i] % 2 != 0:
            ans += 1
    
    print(ans)


if __name__ == "__main__":
    main()


Failing test case input:
15
15 5 71 15 87 98 135 87 0 60 44 11 6 14 19

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):




def main():
    N = int(input())
    A = list(map(int, input().split()))

    ans = 0

    for i in range(N):
        if (i + 1) % 2 != 0 and A[i] % 2 != 0:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
count=0
for i in range(len(a)):
    if(i%2==1 and a[i]%2==1):
        count+=1
print(count)

Failing test case input:
15
15 11 46 15 50 98 93 129 41 43 44 11 6 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
a1 = [0]
a = a1+list(map(int,input().split()))
count=0
for i in range(1,N+1):
    if(i%2==1):
        if(a[i]%2==1):
            
            count+=1

print(count)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = map(int, input().split())
ans = 0
i = 0
for x in a:
  	if i % 2 == x % 2 == 1: ans += 1
  	i += 1
print(ans)

Failing test case input:
15
1 10 109 15 87 98 29 161 0 60 44 11 9 26 19

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a = map(int, input().split())
ans = 0
i = 1
for x in a:
  	if i % 2 == x % 2 == 1: ans += 1
  	i += 1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input("Enter your limit : "))
s = list(map(int,input().split()[:n]))
a = 0
for i in range(1,len(s)):
  if((i%2 != 0) and (s[i]%2 !=0)):
    a+=1
print(a)

Failing test case input:
15
1 3 109 15 87 98 29 161 1 87 9 11 9 14 32

Expected output:
7


Actual output:
Enter your limit : 5


Fixed submission (verdict: Accepted):
n = int(input())
s = list(map(int,input().split()))
a = 0
for i in range(n):
  if i%2 == 0 and s[i]%2 ==1:
    a+=1
print(a)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = tuple([int(t)for t in input().split()])

    ans = 0
    for i in range(n):
        if i%2==1 and a[i] %2 == 1:
            ans+=1
    print(ans)
if __name__ == "__main__":
    main()

Failing test case input:
15
15 11 64 15 50 98 93 77 31 43 44 90 6 24 14

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = tuple([int(t)for t in input().split()])

    ans = 0
    for i in range(n):
        if i%2==0 and a[i] %2 == 1:
            ans+=1
    print(ans)
if __name__ == "__main__":
    main()

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
num_list = list(map(int, input().split()))
cns = 0 
for i in range(len(num_list)):
    if i % 2 == 1 and num_list[i] % 2 == 1:
        cns += 1

print(cns)

Failing test case input:
15
15 11 64 15 50 98 93 77 31 43 44 90 6 24 14

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
num_list = list(map(int, input().split()))
cns = 0 
for i in range(len(num_list)):
    if (i + 1) % 2 == 1 and num_list[i] % 2 == 1:
        cns += 1

print(cns)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(N):
    if i % 2 == 1 and a[i] % 2 ==1:
            cnt += 1
    else:
            cnt += 0
print(str(cnt))

Failing test case input:
15
15 5 46 15 50 98 93 87 31 43 44 11 6 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int,input().split()))
cnt = 0
for i in range(N + 1):
    if i % 2 == 1 and a[i - 1] % 2 ==1:
            cnt += 1
    else:
            cnt += 0
print(str(cnt))

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(n):
    if i % 2 == 1 and a[i] % 2 == 1:
        count += 1
print(count)


Failing test case input:
5
2 5 4 5 7

Expected output:
1


Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(n):
    if (i+1) % 2 == 1 and a[i] % 2 == 1:
        count += 1
print(count)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
ans=0
for num , i  in enumerate(a):
    if num%2==1 and i%2==1:
        ans+=1
print(ans)

Failing test case input:
15
15 5 109 15 171 98 135 87 0 60 44 11 6 14 19

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
ans=0
for num , i  in enumerate(a,1):
    if num%2==1 and i%2==1:
        ans+=1
print(ans)

Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(len(a)):
    if i % 2 == 1 and a[i] % 2 == 1:
        ans += 1

print(ans)


Failing test case input:
15
1 3 55 15 000 98 28 78 1 60 0 13 12 13 54

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

ans = 0

for i in range(n):
    if (i+1) % 2 == 1 and a[i] % 2 == 1:
        ans += 1

print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
a = int(input())
b = input().split()
x = 1
y = 0
for i in range(int(a / 2)):
    if int((int(b[x]) + 1) % 2) == 0:
        y = y + 1
    x = x + 2
print(y)

Failing test case input:
15
1 3 109 8 87 98 29 78 1 60 9 11 9 14 32

Expected output:
7


Actual output:
2


Fixed submission (verdict: Accepted):
a = int(input())
b = input().split()
x = 0
y = 0
for i in range(a):
    if len(b) > x:
        if int((int(b[x]) + 1) % 2) == 0:
            y = y + 1
    x = x + 2
print(y)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(n):
    if i%2 == 1 and l[i]%2 == 1:
        ans += 1
print(ans)

Failing test case input:
15
1 0 109 15 87 98 29 161 1 60 44 11 9 14 32

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
l = list(map(int,input().split()))
ans = 0
for i in range(n):
    if (i+1)%2 == 1 and l[i]%2 == 1:
        ans += 1
print(ans)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n =int(input())
li =list(map(int,input().split()))
count =0
for i in range(1,len(li),2):
    if li[i] % 2 !=0:
        count +=1
    

print(count)

Failing test case input:
15
1 10 109 29 87 98 29 161 0 60 44 11 6 14 19

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
n =int(input())
li =list(map(int,input().split()))

count =0
for i in range(0,len(li),2):
    
    if li[i] % 2 !=0:
        count +=1
    

print(count)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
l=list(map(int,input().split()))
cnt= 0
for i in range(N):
    if i%2 == 1 and l[i]%2 ==1:
        cnt += 1
print(cnt)


Failing test case input:
15
15 5 71 15 50 98 135 87 0 43 44 11 6 24 11

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
N=int(input())
l=list(map(int,input().split()))
cnt= 0
for i in range(N):
    if (i+1)%2 == 1 and l[i]%2 ==1:
        cnt += 1
print(cnt)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

a = list(filter(lambda x: x % 2 == 1, a[1::2]))
print(len(a))

Failing test case input:
15
1 10 109 15 87 98 29 161 0 60 44 11 9 26 19

Expected output:
6


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

a = list(filter(lambda x: x % 2 == 1, a[0::2]))
print(len(a))

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(1, n, 2):
    if a[i] % 2 == 1:
        cnt += 1
    else:
        continue
print(cnt)

Failing test case input:
15
15 5 71 15 87 98 135 87 0 60 44 17 6 14 19

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(0, n, 2):
    if a[i] % 2 == 1:
        cnt += 1
    else:
        continue
print(cnt)

Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def resolve():
  N = int(input())
  a = [int(x) for x in input().split(" ")]

  count = 0
  for i, A in enumerate(a):
    if i%2==1 and A%2==1:
      count += 1
  print(count)

if __name__ == "__main__":
  resolve()

Failing test case input:
15
1 3 111 15 000 98 14 78 1 60 15 6 12 13 54

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
def resolve():
  N = int(input())
  a = [int(x) for x in input().split(" ")]

  count = 0
  for i, A in enumerate(a):
    if i%2==0 and A%2==1:
      count += 1
  print(count)

if __name__ == "__main__":
  resolve()

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(N):
  if(i%2==1):
    if(a[i]%2==1):
      count+=1
print(count)

Failing test case input:
15
1 3 55 15 000 98 28 78 1 60 0 13 12 13 54

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N=int(input())
a=list(map(int,input().split()))
count=0
for i in range(N):
  if(i%2==0):
    if(a[i]%2==1):
      count+=1
print(count)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))

cnt = 0
for i, e in enumerate(a):
    if i % 2 == 1 and e % 2 == 1:
        cnt += 1

print(cnt)


Failing test case input:
15
1 3 109 15 77 98 29 78 1 60 9 11 9 13 32

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))

cnt = 0
for i, e in enumerate(a):
    if (i+1) % 2 == 1 and e % 2 == 1:
        cnt += 1

print(cnt)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
a = []
a = input().split()

count = 0

for i in range(int(N/2)):
  cd = 2 * i - 1
  jd = int(a[cd])
  if jd % 2 == 1:
    count += 1
    

print(count)

Failing test case input:
15
1 3 55 15 77 154 28 78 1 60 9 13 12 13 54

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))

count = 0

for i in range(0,N,2):
  jd = a[i]
  if jd % 2 == 1:
    count += 1

print(count)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
*a,=map(int,input().split())
count=0
for i in range(n):
    if i%2==1 and a[i]%2==1:
        count+=1
print(count)

Failing test case input:
15
1 3 109 15 77 98 29 78 1 60 9 11 1 13 32

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
*a,=map(int,input().split())
count=0
for i in range(n):
    if (i+1)%2==1 and a[i]%2==1:
        count+=1
print(count)

Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
def main():
    n = int(input())
    A = list(map(int,input().split()))
    ans = 0
    for i in range(n):
        if i%2 == 1 and A[i]%2 == 1:
            ans += 1
    print(ans)
    return
if __name__ == "__main__":
    main()

Failing test case input:
15
15 11 46 15 50 98 93 87 31 43 44 11 10 24 14

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    A = list(map(int,input().split()))
    ans = 0
    for i in range(n):
        if (i+1)%2 == 1 and A[i]%2 == 1:
            ans += 1
    print(ans)
    return
if __name__ == "__main__":
    main()

Problem: p02607
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(N):
  if i % 2 != 0:
    if a[i] % 2 != 0:
      ans += 1
print(ans)

Failing test case input:
15
1 3 109 15 87 98 29 161 1 60 8 11 9 14 32

Expected output:
6


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int,input().split()))
ans = 0
for i in range(N):
  if (i+1) % 2 != 0:
    if a[i] % 2 != 0:
      ans += 1
print(ans)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
Ali = list(map(int,input().split()))
r = 0
for i in range(N):
  if Ali[i]%2 == 1 and i%2 == 1:
    r += 1
    
print(r)

Failing test case input:
15
1 3 109 15 77 98 29 78 1 60 9 11 9 14 32

Expected output:
7


Actual output:
3


Fixed submission (verdict: Accepted):
N = int(input())
Ali = list(map(int,input().split()))
r = 0
for i in range(N):
  if Ali[i]%2 == 1 and i%2 == 0:
    r += 1
    
print(r)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

num = 0
for i in range(n):
    if i % 2 == 1:
        if a[i] % 2 == 1:
            num += 1

print(num)

Failing test case input:
15
1 3 109 15 87 98 29 258 0 60 44 11 9 14 32

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

num = 0
for i in range(n):
    if (i+1) % 2 == 1:
        if a[i] % 2 == 1:
            num += 1

print(num)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n)[::2]:
    if a[i]%2 != 1:
        ans += 1

print(ans)

Failing test case input:
15
1 3 55 15 100 98 28 78 2 60 9 13 12 13 54

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))
ans = 0
for i in range(n)[::2]:
    
    if a[i]%2 != 0:
        ans += 1

print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n):
  if i%2==1 and a[i-1]%2==1:
    ans+=1
print(ans)

Failing test case input:
15
15 5 71 15 50 98 135 87 0 60 44 11 12 14 19

Expected output:
4


Actual output:
3


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(1,n+1):
  if i%2==1 and a[i-1]%2==1:
    ans+=1
print(ans)

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

count = 0

for i, a in enumerate(A):
  if i%2 and a%2:
    count += 1
print(count)

Failing test case input:
15
1 3 55 15 77 98 29 78 1 60 9 11 9 13 32

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

count = 0

for i, a in enumerate(A):
  if (i+1)%2 and a%2:
    count += 1
print(count)
Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    n = int(input())
    a = list(map(int, input().split()))

    cnt = 0
    for i, e in enumerate(a):
        if i % 2 == 1 and e % 2 == 1:
            cnt += 1

    print(cnt)




if __name__ == '__main__':
    main()

Failing test case input:
15
1 10 109 15 87 98 29 161 0 60 86 11 9 14 32

Expected output:
5


Actual output:
3


Fixed submission (verdict: Accepted):
def main():
    n = int(input())
    a = list(map(int, input().split()))

    cnt = 0
    for i, e in enumerate(a):
        if (i+1) % 2 == 1 and e % 2 == 1:
            cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()

Problem: p02607
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

counter = 0
for i in range(N):
    checker_1 = i % 2 == 1
    checker_2 = A[i] % 2 == 1
    if checker_1 & checker_2:
        counter += 1
print(counter)

Failing test case input:
15
1 3 55 15 77 98 28 78 1 60 9 13 12 13 32

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

counter = 0
for i in range(N):
    checker_1 = (i + 1) % 2 == 1
    checker_2 = A[i] % 2 == 1
    if checker_1 & checker_2:
        counter += 1
print(counter)
Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
temp = input().rstrip().split(" ")
list1 = []
for i in range(N):
    list1.append(int(temp[i]))
list1.sort()
avg = sum(list1) / len(list1)
ans = 0
for i in range(N):
    ans += (list1[i] - avg)**2
print(int(ans))

Failing test case input:
2
23 -4

Expected output:
365


Actual output:
364


Fixed submission (verdict: Accepted):
N = int(input())
temp = input().rstrip().split(" ")
list1 = []
for i in range(N):
    list1.append(int(temp[i]))
list1.sort()
avg = round(sum(list1) / len(list1))
ans = 0
for i in range(N):
    ans += (list1[i] - avg)**2
print(ans)

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

import math
n = input()
numbers = list(map(int, input().split()))

unique_numbers = list(set(numbers))
if len(unique_numbers) == 1:
  print(0)
  exit(0)

s = sum(numbers)
t = math.floor(s/2)

r = 0
for num in numbers:
  r += abs((num - t) ** 2)
  
print(r)


Failing test case input:
3
3 -1 13

Expected output:
104


Actual output:
116


Fixed submission (verdict: Accepted):

import math
n = input()
numbers = list(map(int, input().split()))

unique_numbers = list(set(numbers))
if len(unique_numbers) == 1:
  print(0)
  exit(0)

min_num = min(numbers)
max_num = max(numbers)

results = []
for i in range(min_num, max_num):
  r = 0
  for num in numbers:
    r += abs((num - i) ** 2)
  results.append(r)

min_r = min(results)
print(min_r)

Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
a=[int(i)for i in input().split()]
b=round(sum(set(a))/len(set(a)))
print(0 if len(a)==a.count(b) else sum([(i-b)**2 for i in a]))

Failing test case input:
3
1 1 8

Expected output:
33


Actual output:
34


Fixed submission (verdict: Accepted):
n=int(input())
a=[int(i)for i in input().split()]
b=round(sum(a)/n)
print(sum([(i-b)**2 for i in a]))

Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
A = list(map(int,input().split()))

sum = 0
result = 0

for i in A:
    sum+=i
ave = sum/len(A)

for i in A:
    result += pow(i-ave,2)

print(round(result))

Failing test case input:
2
80 -3

Expected output:
3445


Actual output:
3444


Fixed submission (verdict: Accepted):
import math
N = int(input())
A = list(map(int,input().split()))

sum = 0
result = 0

for i in A:
    sum+=i
ave = round(sum/len(A))

for i in A:
    result += pow(i-ave,2)

print(round(result))

Problem: p04031
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
arr = list(map(int, input().split()))

mini = min(arr)
maxi = max(arr)
cost = 10000

for i in range(mini, maxi+1):
    add = 0
    for j in range(n):
        add = add + (arr[j] - i)**2
    cost = min(cost, add)
print(cost)

Failing test case input:
2
203 -4

Expected output:
21425


Actual output:
10000


Fixed submission (verdict: Accepted):
n = int(input())
arr = list(map(int, input().split()))

mini = min(arr)
maxi = max(arr)
cost = 10000000000

for i in range(-100, 101+1):
    add = 0
    for j in range(n):
        add = add + (arr[j] - i)**2
    cost = min(cost, add)
print(cost)
Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))

avg = sum(a) 
ans = 20100
for i in range(avg, avg + 2):
    tmp = 0
    for j in range(N):
        tmp += (a[j] - i) ** 2
    ans = min(ans, tmp)
print(ans)



Failing test case input:
3
-19 0 0

Expected output:
241


Actual output:
649


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))

ans = 100100100
for i in range(-100, 101):
    tmp = 0
    for j in range(N):
        tmp += (a[j] - i) ** 2
    ans = min(ans, tmp)
print(ans)

Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
a = list(map(int, input().split()))
al = min(a)
ar = max(a)
ans = 20000
for i in range(al, ar+1):
    tmp = 0
    for j in a:
        tmp += (j-i) ** 2
    if ans > tmp:
        ans = tmp
print(ans)

Failing test case input:
2
203 -4

Expected output:
21425


Actual output:
20000


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int, input().split()))
al = min(a)
ar = max(a)
ans = 1000000000000000
for i in range(al, ar+1):
    tmp = 0
    for j in a:
        tmp += (j-i) ** 2
    if ans > tmp:
        ans = tmp
print(ans)

Problem: p04031
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
a=list(map(int,input().split()))
ave=sum(a)/N
if ave%1>=0.5:
    if ave>=0:
        ave=int(ave)+1
    else:
        ave=int(ave)-1
else:
    ave=int(ave)
ans=0
for i in a:
    ans+=(ave-i)**2
print(ans)


Failing test case input:
3
-20 1 -3

Expected output:
249


Actual output:
250


Fixed submission (verdict: Accepted):
N=int(input())
a=list(map(int,input().split()))
ave=sum(a)/N
if ave>=0 and ave%1>=0.5:
    ave=int(ave)+1
elif ave<0 and -ave%1>=0.5:
    ave=int(ave)-1
else:
    ave=int(ave)
ans=0
for i in a:
    ans+=(i-ave)**2
print(ans)

Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
ans = float('inf')

for i, a in enumerate(A):
  cost = 0
  for j, aj in enumerate(A):
    cost += (aj - a)**2
  ans = min(ans, cost)

print(ans)

Failing test case input:
4
-100 -45 -100 -100

Expected output:
2269


Actual output:
3025


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
ans = float('inf')

for target in range(-100, 101):
  cost = 0
  for j, a in enumerate(A):
    cost += (target - a)**2
  ans = min(ans, cost)

print(ans)

Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
a = input()
b = list(map(int, input().split()))
c = round(sum(b) / len(b))
sum = 0
for i in range(len(b)):
    sum += (b[i] - c) ^ 2
print(sum)

Failing test case input:
3
3 0 7

Expected output:
25


Actual output:
7


Fixed submission (verdict: Accepted):
a = input()
b = list(map(int, input().split()))
c = round(sum(b) / len(b))
s = 0
for i in range(len(b)):
    s += ((b[i] - c) ** 2)
print(s)
Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n=int(input())
a=map(int, input().split())
ave = sum(a)/n
if math.ceil(ave)-ave > ave-math.floor(ave):
    t = math.floor(ave)
else:
    t = math.ceil(ave)
print(sum([(t-x)**2 for x in a]))

Failing test case input:
3
0 -1 21

Expected output:
309


Actual output:
0


Fixed submission (verdict: Accepted):
import math
n=int(input())
a=list(map(int, input().split()))
ave = sum(a)/n
if math.ceil(ave)-ave > ave-math.floor(ave):
    t = math.floor(ave)
else:
    t = math.ceil(ave)
total = 0
for v in a:
    total += (t-v) ** 2
print(total)

Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())
lst = [int(x) for x in input().split()]
a = math.ceil(sum(lst) / N)

ret = sum([math.pow(a - x, 2) for x in lst])
print(int(ret))

Failing test case input:
3
-20 0 -3

Expected output:
233


Actual output:
234


Fixed submission (verdict: Accepted):
N = int(input())
lst = [int(x) for x in input().split()]

ret = 100 ** 100
for x in range(-100, 101):
    ret = min(ret, sum([(x - n) ** 2 for n in lst]))

print(ret)

Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = list(int(i) for i in input().split())
def costcalc(x):
  a2 = 0
  for i in range(n):
    a2 += (a[i]-x)**2
  return a2

cost = 10*15
for i in range(200):
  check = i-100
  cost = min(cost,costcalc(check))
print(cost)

Failing test case input:
2
90 -4

Expected output:
4418


Actual output:
150


Fixed submission (verdict: Accepted):
n = int(input())
a = list(int(i) for i in input().split())
def costcalc(x):
  a2 = 0
  for i in range(n):
    a2 += (a[i]-x)**2
  return a2

cost = 10**15
for i in range(201):
  check = i-100
  cost = min(cost,costcalc(check))
  
print(cost)
Problem: p04031
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
S = 100000000
for i in range(-100,101):
    T = 0
    for j in range(N):
        T += (A[j] - i)**2
    print("i",i,"T",T)
    if S > T:
        S = T
print(S)

Failing test case input:
3
1 0 50

Expected output:
1634


Actual output:
i -100 T 42701
i -99 T 42002
i -98 T 41309
i -97 T 40622
i -96 T 39941
i -95 T 39266
i -94 T 38597
i -93 T 37934
i -92 T 37277
i -91 T 36626
i -90 T 35981
i -89 T 35342
i -88 T 34709
i -87 T 34082
i -86 T 33461
i -85 T 32846
i -84 T 32237
i -83 T 31634
i -82 T 31037
i -81 T 30446
i -80 T 29861
i -79 T 29282
i -78 T 28709
i -77 T 28142
i -76 T 27581
i -75 T 27026
i -74 T 26477
i -73 T 25934
i -72 T 25397
i -71 T 24866
i -70 T 24341
i -69 T 23822
i -68 T 23309
i -67 T 22802
i -66 T 22301
i -65 T 21806
i -64 T 21317
i -63 T 20834
i -62 T 20357
i -61 T 19886
i -60 T 19421
i -59 T 18962
i -58 T 18509
i -57 T 18062
i -56 T 17621
i -55 T 17186
i -54 T 16757
i -53 T 16334
i -52 T 15917
i -51 T 15506
i -50 T 15101
i -49 T 14702
i -48 T 14309
i -47 T 13922
i -46 T 13541
i -45 T 13166
i -44 T 12797
i -43 T 12434
i -42 T 12077
i -41 T 11726
i -40 T 11381
i -39 T 11042
i -38 T 10709
i -37 T 10382
i -36 T 10061
i -35 T 9746
i -34 T 9437
i -33 T 9134
i -32 T 8837
i -31 T 8546
i -30 T 8261
i -29 T 7982
i -28 T 7709
i -27 T 7442
i -26 T 7181
i -25 T 6926
i -24 T 6677
i -23 T 6434
i -22 T 6197
i -21 T 5966
i -20 T 5741
i -19 T 5522
i -18 T 5309
i -17 T 5102
i -16 T 4901
i -15 T 4706
i -14 T 4517
i -13 T 4334
i -12 T 4157
i -11 T 3986
i -10 T 3821
i -9 T 3662
i -8 T 3509
i -7 T 3362
i -6 T 3221
i -5 T 3086
i -4 T 2957
i -3 T 2834
i -2 T 2717
i -1 T 2606
i 0 T 2501
i 1 T 2402
i 2 T 2309
i 3 T 2222
i 4 T 2141
i 5 T 2066
i 6 T 1997
i 7 T 1934
i 8 T 1877
i 9 T 1826
i 10 T 1781
i 11 T 1742
i 12 T 1709
i 13 T 1682
i 14 T 1661
i 15 T 1646
i 16 T 1637
i 17 T 1634
i 18 T 1637
i 19 T 1646
i 20 T 1661
i 21 T 1682
i 22 T 1709
i 23 T 1742
i 24 T 1781
i 25 T 1826
i 26 T 1877
i 27 T 1934
i 28 T 1997
i 29 T 2066
i 30 T 2141
i 31 T 2222
i 32 T 2309
i 33 T 2402
i 34 T 2501
i 35 T 2606
i 36 T 2717
i 37 T 2834
i 38 T 2957
i 39 T 3086
i 40 T 3221
i 41 T 3362
i 42 T 3509
i 43 T 3662
i 44 T 3821
i 45 T 3986
i 46 T 4157
i 47 T 4334
i 48 T 4517
i 49 T 4706
i 50 T 4901
i 51 T 5102
i 52 T 5309
i 53 T 5522
i 54 T 5741
i 55 T 5966
i 56 T 6197
i 57 T 6434
i 58 T 6677
i 59 T 6926
i 60 T 7181
i 61 T 7442
i 62 T 7709
i 63 T 7982
i 64 T 8261
i 65 T 8546
i 66 T 8837
i 67 T 9134
i 68 T 9437
i 69 T 9746
i 70 T 10061
i 71 T 10382
i 72 T 10709
i 73 T 11042
i 74 T 11381
i 75 T 11726
i 76 T 12077
i 77 T 12434
i 78 T 12797
i 79 T 13166
i 80 T 13541
i 81 T 13922
i 82 T 14309
i 83 T 14702
i 84 T 15101
i 85 T 15506
i 86 T 15917
i 87 T 16334
i 88 T 16757
i 89 T 17186
i 90 T 17621
i 91 T 18062
i 92 T 18509
i 93 T 18962
i 94 T 19421
i 95 T 19886
i 96 T 20357
i 97 T 20834
i 98 T 21317
i 99 T 21806
i 100 T 22301
1634


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
S = 100000000
for i in range(-100,101):
    T = 0
    for j in range(N):
        T += (A[j] - i)**2
    if S > T:
        S = T
print(S)