Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n, i):
        tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n+1, i):
        tmp += count[j-1]
    #print(tmp)
    if a[i-1] % 2 != tmp % 2:
        count[i-1] += 1
#print(count)
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i+1))

print(m)
print(' '.join(ans))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n, i):
        if j % i == 0:
            tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n+1, i):
        tmp += count[j-1]
    #print(tmp)
    if a[i-1] % 2 != tmp % 2:
        count[i-1] += 1
#print(count)
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i+1))

print(m)
print(' '.join(ans))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n, i):
        if j % i == 0:
            tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = count.count(1)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n+1, i):
        tmp += count[j-1]
    #print(tmp)
    if a[i-1] % 2 != tmp % 2:
        count[i-1] += 1
#print(count)
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i+1))

print(m)
print(' '.join(ans))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n):
        if j % 1 == 0:
            tmp += a[j]
    if a[i-1] % 2 != tmp % 2:
        count[i] += 1
m = count.count(1)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i))

print(m)
print(' '.join(ans))


Fixed submission:
# -*- coding: utf-8 -*-
n = int(input())
a = [int(i) for i in input().split()]

count = [0 for _ in range(n)]
for i in reversed(range(1, n + 1)):
    tmp = 0
    for j in range(i, n+1, i):
        tmp += count[j-1]
    #print(tmp)
    if a[i-1] % 2 != tmp % 2:
        count[i-1] += 1
#print(count)
m = sum(count)
ans = []
for i in range(n):
    if count[i] == 1:
        ans.append(str(i+1))

print(m)
print(' '.join(ans))