Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0] + list(map(int, input().split()))

for i in range(N+1, 0, -1):
    tmp = 0
    j = i
    while j < N+1:
        tmp += A[j]
        j += i
    A[i] = tmp % 2
ans = []
for i, j in enumerate(A):
    if j == 1:
        ans.append(i)

print(len(ans))
print(*ans)


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

for i in range(N//2, 0, -1):
    # tmp = 0
    # j = i
    # while j < N+1:
    #     tmp += A[j]
    #     j += j
    # A[i] = tmp % 2
    A[i] = sum(A[i::i]) % 2
ans = [i for i, j in enumerate(A) if j == 1]

print(len(ans))
print(*ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0] + list(map(int, input().split()))

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

ret = []
for i in range(1, tmp+1):
    if i % tmp == 0:
        ret.append(i)
print(len(ret))
print(*ret)

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

for i in range(N//2, 0, -1):
    # tmp = 0
    # j = i
    # while j < N+1:
    #     tmp += A[j]
    #     j += j
    # A[i] = tmp % 2
    A[i] = sum(A[i::i]) % 2
ans = [i for i, j in enumerate(A) if j == 1]

print(len(ans))
print(*ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0] + list(map(int, input().split()))

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

print(tmp)
for i in range(1, tmp+1):
    if i % tmp == 0:
        print(i)


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

for i in range(N//2, 0, -1):
    # tmp = 0
    # j = i
    # while j < N+1:
    #     tmp += A[j]
    #     j += j
    # A[i] = tmp % 2
    A[i] = sum(A[i::i]) % 2
ans = [i for i, j in enumerate(A) if j == 1]

print(len(ans))
print(*ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0] + list(map(int, input().split()))

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

print(tmp)
for i in range(1, tmp+1):
    if i % tmp == 0:
        print(i)


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

for i in range(N//2, 0, -1):
    # tmp = 0
    # j = i
    # while j < N+1:
    #     tmp += A[j]
    #     j += j
    # A[i] = tmp % 2
    A[i] = sum(A[i::i]) % 2
ans = [i for i, j in enumerate(A) if j == 1]

print(len(ans))
print(*ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0] + list(map(int, input().split()))

for i in range(N-1, 0, -1):
    tmp = 0
    for t in range(i, N+1, i):
        tmp += A[t]
    if tmp == i:
        break

print(tmp)
for i in range(1, tmp+1):
    if i % tmp == 0:
        print(i)


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

for i in range(N//2, 0, -1):
    # tmp = 0
    # j = i
    # while j < N+1:
    #     tmp += A[j]
    #     j += j
    # A[i] = tmp % 2
    A[i] = sum(A[i::i]) % 2
ans = [i for i, j in enumerate(A) if j == 1]

print(len(ans))
print(*ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [0] + list(map(int, input().split()))

for i in range(N-1, 0, -1):
    tmp = 0
    for t in range(i, N, i):
        tmp += A[t]
    if tmp == i:
        break

print(tmp)
for i in range(1, tmp+1):
    if i % tmp == 0:
        print(i)


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

for i in range(N//2, 0, -1):
    # tmp = 0
    # j = i
    # while j < N+1:
    #     tmp += A[j]
    #     j += j
    # A[i] = tmp % 2
    A[i] = sum(A[i::i]) % 2
ans = [i for i, j in enumerate(A) if j == 1]

print(len(ans))
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

def amount(num, A):
    ret = 0
    for i, a in enumerate(A):
        if (i+1) % num == 0:
            ret += a
    return ret

tmp = 0
for i in range(N-1, -1, -1):
    tmp = amount(i+1, A)
    if tmp == i:
        tmp = i
        break

print(tmp)
for i in range(1, tmp+1):
    if i % tmp == 0:
        print(i)


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

for i in range(N//2, 0, -1):
    # tmp = 0
    # j = i
    # while j < N+1:
    #     tmp += A[j]
    #     j += j
    # A[i] = tmp % 2
    A[i] = sum(A[i::i]) % 2
ans = [i for i, j in enumerate(A) if j == 1]

print(len(ans))
print(*ans)