Problem:


Score : 200 points

Problem Statement

We have N squares assigned the numbers 1,2,3,\ldots,N. Each square has an integer written on it, and the integer written on Square i is a_i.

How many squares i satisfy both of the following conditions?

The assigned number, i, is odd.

The written integer is odd.

Constraints

All values in input are integers.

1 \leq N, a_i \leq 100

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 \cdots a_N

Output

Print the number of squares that satisfy both of the conditions.

Sample Input 1

5
1 3 4 5 7

Sample Output 1

2

Two squares, Square 1 and 5, satisfy both of the conditions.

For Square 2 and 4, the assigned numbers are not odd.

For Square 3, the written integer is not odd.

Sample Input 2

15
13 76 46 15 50 98 93 77 31 43 84 90 6 24 14

Sample Output 2

3



Sample input:
5
1 3 4 5 7


Sample output:
2

Submission status: Runtime Error

Solution code:
N=int(input())
X=input()
xx=int(X)
xxx=str(xx)
sa=N-len(xxx)
X_len=len(X)
a=0
for i in range(sa,N):
    a=int(X[i])*(2**(N-i-1))+a





fx=[-1]*(2*(10**5))
for i in range(X_len):
    ans=0
    if(X[i]=='0'):
        b=a+2**(X_len-i-1)
    else:
        b=a-2**(X_len-i-1)

    while(b!=0):

        fx=b%str(format(b,'b')).count('1')
        ans=ans+1
        b=fx

    print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in range (n)]
b = 0

if (i+1)%2==1 and a[i]%2==1 :
  b +=1
else:
  b +=0
print(b)

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int,input().split()))
m = []
for i in range(n):
  if i%2==0 and l[i]%2!=0:
    l[i].append(m)
print(m)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [i for i in range (n)]
b = 0

if i%2==1 and a[i]%2==1 :
  b +=1
else:
  b +=0
print(b)

Submission status: Runtime Error

Solution code:
n = int(input())
l = map(int,input().split())
m = []
for i in range(n):
  if i%2==0 and l[i]%2!=0:
    l[i].append(m)
print(m)

Submission status: Runtime Error

Solution code:
n = int(input())
l = map(int,input().split())
m = []
for i in range(1,n):
  if i%2!=0 and l[i-1]%2!=0:
    l[i-1].append(m)
print(m)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))

for i in range(a):
    if (i+1) * a[i] % 2 != 1:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
a = 15
print "3"

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(0, n+1, 2):
    if a[i]%2:
        count += 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
a = [int(a) for i, a in enumerate(input().split()) if i%2 == 0]
ans = [i for i in a if a%2==1]
print(len(ans))

Submission status: Runtime Error

Solution code:
N = int(input())
ans = [int(a) for i, a in enumerate(input().split()) if i%2 == 0 and if a%2==1]

print(len(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))


def cal(n):
    result = 0
    totyu = 1
    for _ in range(n-1):
        if a[totyu] % 2 !=0:
            result += 1
            totyu += 2
        else :
            totyu += 2
    return result

if n % 2 == 0:
    n /= 2
else:
    n = n//2 +1 

print(cal(n))

Submission status: Runtime Error

Solution code:

N=15
input=input()

masu=[int(r) for r in input.split()]
ans=[]

for i in range(1,N+1,2):

    if masu[i-1]%2==1 and i%2==1:
        ans.append(i)

print(len(ans))

Submission status: Runtime Error

Solution code:
l=list()
N=int(input())
for i in range(1,N+1,1):
  n=int(input)
  l.append(n)
c=0 
for i in range(len(l)):
  if((i%2)!=0)and(((l[i])%2)!=0):
    c=c+1
print(c)

Submission status: Runtime Error

Solution code:
l=list()
N=int(input())
for i in range(1,N+1,1):
  n=int(input()
  l.append(n)
c=0 
for i in range(len(l)):
  if((i%2)!=0)and(((l[i])%2)!=0):
    c=c+1
print(c)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

N = int(input())
# print(N)
ai = input().split(' ')
# print(ai)
num = 0
for i in range(N):
    if i % 2 == 0:
        if int(ai[i*2]) % 2 == 1:
            # print('asd' + str(i))
            # print('hoge' + str(ai[i*2]))
            num += 1

print(num)

Submission status: Runtime Error

Solution code:
N=int(input())
table=list(map(int,input().split()))
num=0
for i in table:
    if i%2==1 and (table[i])%2==1:
        num+=1
    print(num)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
a=list(map(int,input().split()))
D=0
D=N%2
if D==0:
    N=N/2
else:
    N=int(N/2)+1
    for i in range(0,N):
        C=0
        B=0
        i=i+0
        B=a[i]%2
        if B!=0:
            C=C+1
            
print(C)

Submission status: Runtime Error

Solution code:
 = int(input())
a = list(map(int, input().split()))
print(len([i for i, ai in enumerate(a) if i%2 and ai%2]))

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(int,input().split())
arr = arr[::2]
def odd(n) : return (n%2==1)
lst = filter(odd,arr)
print(len(lst))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

N = int(input())
# print(N)
ai = input().split(' ')
# print(ai)
num = 0
for i in range(math.floor(N/2) + 1):
    if int(ai[i*2]) % 2 == 1:
        # print('asd' + str(i))
        # print('hoge' + str(ai[i*2]))
        num += 1

print(num)

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int,input().split()))

if(N%2 == 0):
  N = (N/2)
else:
  N = int(N/2)+1
count = 0
for i in range(1,N+1):
  if(a[(2*i-1)-1]%2 == 1):
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())  # nは入力回数
num_list = list(map(int, input().split()))
count = 0

if n//2 == 0:
  for i in range(n//2):
    if (num_list[2*i]%2) == 1:
      count += 1
else:
  for i in range((n//2) + 1):
    if (num_list[2*i]%2) == 1:
      count += 1
      
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(int,input().split())
arr = arr[::2]
count = 0
for i in arr:
  if i%2==1: count+= 1
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
ai = [int(x) for x in input().split()]


c = 0

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

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(mod==True,arr))
print(len(lst))

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(lambda x: mod(x),arr[::2]))
print(len(lst))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

N = input()
# print(N)
ai = input().split()
# print(ai)
num = 0
for i in range(N/2):
    if ai[i + 1] % 2 == 1:
        num += 1

print(num)

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(int,input().split())
def mod(i): return i%2==1
lst = list(filter(mod,arr[::2]))
print(len(lst))

Submission status: Runtime Error

Solution code:
N =int(input())
a =list(map(int,input().split()))

#print(a)
count = 0
D = []
for i in range(N+1):
    if i % 2 == 0:
        D.append(i)

#print(D)   

for j in D:
    if a[j] % 2 != 0:
        count += 1
        

print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(int,input().split())
lst = filter(i%2==1,arr[::2])
print(len(lst))

Submission status: Runtime Error

Solution code:
n = int(input())
lst = list(map(int, input().split()))
count = 0

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

Submission status: Runtime Error

Solution code:
N= map(int, input())
a = list(map(int,input().split()))

counter=0
for i in range(N):
  print(a[i])

Submission status: Runtime Error

Solution code:
N= map(int, input())
a = list(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(int,input().split())
for i in range(0,n,2):
  if arr[i]%2 == 1 : count+=1
print(count)

Submission status: Runtime Error

Solution code:
n = int(input())
num = list(map(int, input().split()))

cnt = 0
for i in range( n // 2 + 1):
    print((2*i + 1))
    if num[2*i] % 2 == 1:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

N = map(int, input().split())
ai = input().split()

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

print(num)

Submission status: Runtime Error

Solution code:
N= map(int, input())
a = list(map(int,input().split()))

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

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
count = 0

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

N = map(int, input().split())
ai = input().split()

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

print(i)

Submission status: Runtime Error

Solution code:
N = int(input())
s = list(map(int, input().split()))

count = 0

for i in range(N+1):
  if ((i+1)%2 == 1) and (s[i]%2 == 1):
    count = count + 1

print(count)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import math

N = map(int, input().split())
ai = input().split()

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

print(i)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
count = 0

for i in range((N+2)//2):
    if A[2*i ] % 2 == 1:
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N=int(input())
a=list(map(int,input().split()))
b=0
c=N//2

for i in range(c+1):
  if (a[2*i] %2 !=0):
    b +=1

print(b)

Submission status: Runtime Error

Solution code:
N = int(input())
arr = tuple(map(int, input().split()))
count = 0

for i in range(0, N + 1, 2):
    if arr[i] % 2 != 0:
        count += 1
        
print(count)

Submission status: Runtime Error

Solution code:

c=0
n = int(input())
a= [int(i) for i in input().split()]
for i in range(0,n+1,2):
  if a[i]%2==1:
    c+=1

print(c)

Submission status: Runtime Error

Solution code:
N = int(input())
a = list(map(int, input().split()))
count = 0

for i in range(N//2+1):
    if(a[i*2]//2 != 0):
        count += 1
    else:
        pass
        
print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
count = 0

for i in range((N+2)//2):
    if A[2*i ] % 2 == 1:
        count += 1

print(count)

Submission status: Runtime Error

Solution code:
N = int(input())
arr = map(int, input().split())
count = 0

for i in range(0, N + 1, 2):
    if arr[i] % 2 != 0:
        count += 1
        
print(count)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
A = np.array(li,
A = A.reshape((int(N/2), 2))[:,0] if N % 2 == 0 else np.append(A, 2, 100).reshape((int((N+1)/2), 2))[:, 0]
print((A % 2 == 1).sum())

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(0,n+1,2):
  if a[i]%2==1:
    count+=1
  else:
    continue
print(count)

Submission status: Runtime Error

Solution code:
# 解答
def abc173_a(lines):
    N = int(lines[0])
    values = map(int, lines[1].split(' '))
    answer = 0
    tmp = list()
    for value in values:
        tmp.append(value)
    print(f'tmp=[{tmp}]')
    print(f'tmp[0]=[{tmp[0]}]')
    for i in range(N):
        if i % 2 != 0:
            pass
        else:
            if tmp[i] % 2 != 0:
                answer += 1
    return [answer]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['5', '1 3 4 5 7']
        lines_export = [2]
    elif pattern == 2:
        lines_input = ['15', '13 76 46 15 50 98 93 77 31 43 84 90 6 24 14']
        lines_export = [3]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    if len(args) == 1:
        mode = 0
    else:
        mode = int(args[1])
    return mode


# 主処理
def main():
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(1)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = abc173_a(lines_input)

    for line_result in lines_result:
        print(line_result)

    if mode > 0:
        print(f'lines_input=[{lines_input}]')
        print(f'lines_export=[{lines_export}]')
        print(f'lines_result=[{lines_result}]')
        if lines_result == lines_export:
            print('OK')
        else:
            print('NG')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
arr = map(int, input().split())
count = 0

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

Submission status: Runtime Error

Solution code:
def resolve():
    N = int(input()) // 2 * 2 
    A = list(map(int,input().split()))
    ans = 0

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

Submission status: Runtime Error

Solution code:
N = int(input())
arr = map(int, input().split())
count = 0

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

Submission status: Runtime Error

Solution code:
import sys
import numpy as np
import math  # gcdもあるよ
from collections import deque
from collections import defaultdict
from copy import deepcopy
from itertools import accumulate #リストを与えると累積和を返す
def input(): return sys.stdin.readline().rstrip()
from functools import lru_cache #メモ化

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

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
N = int(input())
arr = map(int, input().split())
count = 0

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

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(0,N+1,2):
  if A[i]%2!=0:
    ans+=1
print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import math
import itertools
import numpy as np

t = int(input())
a=list(map(int, input().split()))
num = 0
for i in range(t):
    if i%2 == 0 and g_all[i]%2 == 1:
        num+=1
print(num)

Submission status: Runtime Error

Solution code:
n=int(input())
lst=list(map(int,input().split()))
ans=0
for i in range(0,n+1):
 if (i+1)%2==0:
    pass
 elif lst[i]%2!=0:
    ans+=1
 else:
  pass
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
a=map(int,input().split())

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

Submission status: Runtime Error

Solution code:
x = int(input())
c = [i for i in range(1,x+1)]
l = map(int,input().split())
count = 0
for i,j in zip(c,l):
	if i% 2== 1 and j%2 == 1:
		count+=1a
print(count)

Submission status: Runtime Error

Solution code:
 = int(input())
a = list(map(int, input().split()))
cnt = 0
for i in range(0, N):
    if (i+1) % 2 != 0 and a[i] % 2 != 0:
        cnt += 1
print(cnt)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
res = 0
for i in range(1, len(A)+1, 2):
    res += A[i] % 2
print(res)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range(0,N+1,2):
  if A[i]%2==1:
    ans+=1
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
from io import StringIO
import unittest
import numpy as np

def resolve():
    li = sys.stdin.readlines()
    N = int(li[0].strip())
    a = list(map(int, li[1].strip().split(' ')))
    A = np.array(a[0::2])
    A = (A % 2 == 1)
    print(A.sum())
resolve()

Submission status: Runtime Error

Solution code:
n = input()

num = 0
for i in range(1, n+1):
    a = input()
    if i % 2 != 0:
        if a % 2 != 0:
            num = num + a

print(num)

Submission status: Runtime Error

Solution code:
n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range n:
  if i%2!=0 and arr[i]%2!=0:
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
N=int(input())
li = list(map(int,input().split()))

total=0
for i in range(0,N+1,2):
  if li[i]%2==1:
    total+=1
    
print(total)

Submission status: Runtime Error

Solution code:
import math
import itertools
import numpy as np

t = int(input())
g_all = np.array([list(input()) for i in range(t)])
num = 0
for i in range(t):
    if i%2 == 0 and g_all[i]%2 == 1:
        num+=1
print(num)

Submission status: Runtime Error

Solution code:
import math

t = int(input())
g_all = np.array([list(input()) for i in range(t)])
num = 0
for i in range(t):
    if i%2 == 0 and g_all[i]%2 == 1:
        num+=1
print(num)

Submission status: Runtime Error

Solution code:
N=int(input())
a=map(int,input().split())

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n=int(input())
arr=list(map(int,input().split()))
c=0
for i in range n:
  if 1%2!=0 and arr[i]%2!=0:
    c+=1
print(c)

Submission status: Runtime Error

Solution code:
15
13 76 46 15 50 98 93 77 31 43 84 90 6 24 14

Submission status: Runtime Error

Solution code:
N = int(input().rstrip())
a = input().rstrip().split(' ')
num = 0
for i in range(0, N, 1):
  if a[i] % 2 == 1:
    num += 1
print(num)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(0,n.2):
  if a[i] % 2 == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
n = input()
gen = map(int, input().split())
ans = len([i for i,x in gen if i%2==0 and x%2==1])
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))

ans = 0
for i in range(n//2+1):
    if a[2*i] % 2 == 1:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
N N = int(input())
A = list(map(int,input().split()))

ans = 0
for a in range(0,len(A),2):
    if A[a]% 2 == 1:
        ans += 1
print(ans)

Submission status: Runtime Error

Solution code:
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################

n = int(input())
arr = list(map(int , input().split()))
ans = 0
for i in range(1,n+1):
	if arr[i]&1 and i&1:
		ans+=1
print(ans)

Submission status: Runtime Error

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

N = int(input())
A = list(map(int, input().split()))
A = [0] + A

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
res = 0
for i in range(1, n + 1, 2):
    if a[i] % 2 != 0:
        res += 1

print(res)

Submission status: Runtime Error

Solution code:
n = iin()
a = list(map(int, input().split()))
ans = [1 for i in range(n) if a[i]%2 and i%2==0]
print(sum(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
c=0
cc=0
for i in a:
   c+=1
    if c%2==0:
      continue
    if i%2!=0:
      cc+=1
print(cc)

Submission status: Runtime Error

Solution code:
n = int(input())
arr = [int(j) for j in input().split()]
count = 0
for i in range(1, n+1):
  if i%2 == 1 && arr[i-1]%2 == 1:
    count += 1
print(count)

Submission status: Runtime Error

Solution code:
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)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = map(int,input().split())
ans = 0
for i in range(0,N,2):
  if A[i]%2==1:
    ans+=1
    
print(ans)