-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathd.cpp
More file actions
37 lines (34 loc) · 741 Bytes
/
Copy pathd.cpp
File metadata and controls
37 lines (34 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()
int main(){
ll N;
cin >> N;
vll a(N+1);
rep(i, N){
cin >> a[i+1];
}
vll b(N+1, -1);
IREP(i, N+1, 1){
ll count = 0;
for(ll j=i+i; j<=N; j+=i){
count += b[j];
}
b[i] = (count+a[i]) % 2;
}
ll count = 0;
rep(i, N){
count += b[i+1];
}
cout << count << endl;
rep(i, N){
if(b[i+1]>0) cout << (i+1) << endl;
}
}