stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include<iostream>

#include<string>

#include<set>

#include<queue>

#include<algorithm>

using namespace std;

int vis[200];

int main(){

	int t;

	string a;

	cin>>t;

	cin>>a;

	set<char> left;

	set<char> right;

	set<char> final;

	queue<char> q;

	queue<char> p;

	int n=a.length();

	for(int i=0;i<n;i++){

		q.push(a[i]);



	}



	for(int i=0;i<n-1;i++){

		left.insert(a[i]);

		q.pop();

		p=q;

		right.clear();

		while(!p.empty()){

			right.insert(p.front());

			p.pop();

		}

		

		set<char>::iterator it1;

		set<char>::iterator it2;

		for(it1=left.begin();it1!=left.end();it1++){

			final.insert(*it1);

		}

		for(it2=right.begin();it2!=right.end();it2++){

			final.insert(*it2);

		}

		int an=left.size()+right.size()-final.size();

		vis[i]=an;

	

	}

	sort(vis,vis+n-1);

	cout<<vis[n-2]<<endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.0475668992466276x):
#include<iostream>

#include <stdio.h>

#include <cmath>

#include <string>

#define N 105

using namespace std;

int flag[N],key[N],dancing[N];

int main (){

    int a,x,ans,ma;string str("");

    while (cin>>a){

        ans=0;ma=0;

        for (int i=0;i<26;i++){

            flag[i]=0;

            key[i]=0;

            dancing[i]=0;

        }

        cin>>str;

        for (int i=0;i<a;i++){

            char x=str.at(i);

            flag[((int)x)-97]++;

            dancing[((int)x)-97]++;

        }

        for (int i=0;i<a;i++){

            char x=str.at(i);

            if (dancing[((int)x)-97]>=2){

                flag[((int)x)-97]--;

                if (flag[((int)x)-97]>0&&key[((int)x-97)]==0){

                    ma++;

                    key[((int)x)-97]++;

                }

                if (flag[((int)x)-97]==0){

                    ma--;

                }

                if (ans<ma){

                    ans=ma;

                }

            }

        }

        cout<<ans<<endl;

    }

    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <string>

#include <vector>

#include <set>

#include <algorithm>

using namespace std;



int main() {

  int n;

  string s;

  cin >> n >> s;

  int ans = 0;

  for (int i = 0; i < n; ++i) {

    set<char> x, y;

    for (int j = 0; j <= i; ++j) {

      x.insert(s[j]);

    }

    for (int j = i+1; j < n; ++j) {

      y.insert(s[j]);

    }

    vector<char> v(n);

    auto it = set_intersection(x.begin(), x.end(), y.begin(), y.end(), v.begin());

    v.resize(it-v.begin());

    // cout << v.size() << endl;

    // for (auto it : v) {

    //   cout << it <<  ' ';

    // } cout << endl;

    ans = max(ans, (int)v.size());

  }

  cout << ans << endl;

}


// Faster C++ solution for the same problem (measured speedup: 1.0750207818231916x):
#include <map>

#include <set>

#include <ctime>

#include <cmath>

#include <queue>

#include <stack>

#include <vector>

#include <string>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <sstream>

#include <iostream>

#include <algorithm>

#include <functional>

using namespace std;

#define For(i, x, y) for(int i=x;i<=y;i++)  

#define _For(i, x, y) for(int i=x;i>=y;i--)

#define Mem(f, x) memset(f,x,sizeof(f))  

#define Sca(x) scanf("%d", &x)

#define Sca2(x,y) scanf("%d%d",&x,&y)

#define Sca3(x,y,z) scanf("%d%d%d",&x,&y,&z)

#define Scl(x) scanf("%lld",&x);  

#define Pri(x) printf("%d\n", x)

#define Prl(x) printf("%lld\n",x);  

#define CLR(u) for(int i=0;i<=N;i++)u[i].clear();

#define LL long long

#define ULL unsigned long long  

#define mp make_pair

#define PII pair<int,int>

#define PIL pair<int,long long>

#define PLL pair<long long,long long>

#define pb push_back

#define fi first

#define se second 

typedef vector<int> VI;

const double eps = 1e-9;

const int maxn = 110;

const int INF = 0x3f3f3f3f;

const int mod = 1e9 + 7; 

int N,M,K;

char str[maxn];

int num1[maxn];

int num2[maxn];

void solve(){

	int now = 0;

	int ans = 0;

	for(int i = 1; i <= N ; i ++){

		num1[str[i] - 'a']--;

		num2[str[i] - 'a']++;

		if(!num1[str[i] - 'a'] && num2[str[i] - 'a'] >= 2) now--;

		if(num2[str[i] - 'a'] == 1 && num1[str[i] - 'a']) now++;

		ans = max(ans,now);

	}

	cout << ans << endl;

}

int main(){

	Sca(N);

	scanf("%s",str + 1);

	for(int i = 1; i <= N ; i ++){

		num1[str[i] - 'a']++;

	}

	solve();

	return 0;

}
// Slower C++ solution:
#include<iostream>

#include<string>

#include<set>

#include<queue>

#include<algorithm>

using namespace std;

int vis[200];

int main(){

	int t;

	string a;

	cin>>t;

	cin>>a;

	set<char> left;

	set<char> right;

	set<char> final;

	queue<char> q;

	queue<char> p;

	int n=a.length();

	for(int i=0;i<n;i++){

		q.push(a[i]);



	}



	for(int i=0;i<n-1;i++){

		left.insert(a[i]);

		q.pop();

		p=q;

		right.clear();

		while(!p.empty()){

			right.insert(p.front());

			p.pop();

		}

		

		set<char>::iterator it1;

		set<char>::iterator it2;

		for(it1=left.begin();it1!=left.end();it1++){

			final.insert(*it1);

		}

		for(it2=right.begin();it2!=right.end();it2++){

			final.insert(*it2);

		}

		int an=left.size()+right.size()-final.size();

		vis[i]=an;

	

	}

	sort(vis,vis+n-1);

	cout<<vis[n-2]<<endl;



	return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.0686461263222056x):
#include <map>

#include <set>

#include <ctime>

#include <cmath>

#include <queue>

#include <stack>

#include <vector>

#include <string>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <sstream>

#include <iostream>

#include <algorithm>

#include <functional>

using namespace std;

#define For(i, x, y) for(int i=x;i<=y;i++)  

#define _For(i, x, y) for(int i=x;i>=y;i--)

#define Mem(f, x) memset(f,x,sizeof(f))  

#define Sca(x) scanf("%d", &x)

#define Sca2(x,y) scanf("%d%d",&x,&y)

#define Sca3(x,y,z) scanf("%d%d%d",&x,&y,&z)

#define Scl(x) scanf("%lld",&x);  

#define Pri(x) printf("%d\n", x)

#define Prl(x) printf("%lld\n",x);  

#define CLR(u) for(int i=0;i<=N;i++)u[i].clear();

#define LL long long

#define ULL unsigned long long  

#define mp make_pair

#define PII pair<int,int>

#define PIL pair<int,long long>

#define PLL pair<long long,long long>

#define pb push_back

#define fi first

#define se second 

typedef vector<int> VI;

const double eps = 1e-9;

const int maxn = 110;

const int INF = 0x3f3f3f3f;

const int mod = 1e9 + 7; 

int N,M,K;

char str[maxn];

int num1[maxn];

int num2[maxn];

void solve(){

	int now = 0;

	int ans = 0;

	for(int i = 1; i <= N ; i ++){

		num1[str[i] - 'a']--;

		num2[str[i] - 'a']++;

		if(!num1[str[i] - 'a'] && num2[str[i] - 'a'] >= 2) now--;

		if(num2[str[i] - 'a'] == 1 && num1[str[i] - 'a']) now++;

		ans = max(ans,now);

	}

	cout << ans << endl;

}

int main(){

	Sca(N);

	scanf("%s",str + 1);

	for(int i = 1; i <= N ; i ++){

		num1[str[i] - 'a']++;

	}

	solve();

	return 0;

}
// Slower C++ solution:
#include <iostream>

#include <iomanip>

#include <stdio.h>

#include <cstring>

#include <string>

#include <algorithm>

#include <vector>

#include <queue>

#include <set>

#include <map>

#include <functional>

#include <math.h>

using namespace std;



typedef long long ll;

typedef pair<int, int> pii;



int main() {

  int l; string S; cin >> l >> S;



  int mid, ans = 0;

  for (int k = 1; k < l; k++) {

    set<int> s1, s2;

    int cnt = 0;

    for (int i = 0; i < k; i++) s1.insert(S[i]);

    for (int i = k; i < l; i++) s2.insert(S[i]);

    for (auto p:s2) {

      if (s1.find(p) != s1.end()) cnt++;

    }

    ans = max(ans, cnt);

  }

  cout << ans << endl;

}




// Faster C++ solution for the same problem (measured speedup: 1.0716353637202316x):
#include <map>

#include <set>

#include <ctime>

#include <cmath>

#include <queue>

#include <stack>

#include <vector>

#include <string>

#include <cstdio>

#include <cstdlib>

#include <cstring>

#include <sstream>

#include <iostream>

#include <algorithm>

#include <functional>

using namespace std;

#define For(i, x, y) for(int i=x;i<=y;i++)  

#define _For(i, x, y) for(int i=x;i>=y;i--)

#define Mem(f, x) memset(f,x,sizeof(f))  

#define Sca(x) scanf("%d", &x)

#define Sca2(x,y) scanf("%d%d",&x,&y)

#define Sca3(x,y,z) scanf("%d%d%d",&x,&y,&z)

#define Scl(x) scanf("%lld",&x);  

#define Pri(x) printf("%d\n", x)

#define Prl(x) printf("%lld\n",x);  

#define CLR(u) for(int i=0;i<=N;i++)u[i].clear();

#define LL long long

#define ULL unsigned long long  

#define mp make_pair

#define PII pair<int,int>

#define PIL pair<int,long long>

#define PLL pair<long long,long long>

#define pb push_back

#define fi first

#define se second 

typedef vector<int> VI;

const double eps = 1e-9;

const int maxn = 110;

const int INF = 0x3f3f3f3f;

const int mod = 1e9 + 7; 

int N,M,K;

char str[maxn];

int num1[maxn];

int num2[maxn];

void solve(){

	int now = 0;

	int ans = 0;

	for(int i = 1; i <= N ; i ++){

		num1[str[i] - 'a']--;

		num2[str[i] - 'a']++;

		if(!num1[str[i] - 'a'] && num2[str[i] - 'a'] >= 2) now--;

		if(num2[str[i] - 'a'] == 1 && num1[str[i] - 'a']) now++;

		ans = max(ans,now);

	}

	cout << ans << endl;

}

int main(){

	Sca(N);

	scanf("%s",str + 1);

	for(int i = 1; i <= N ; i ++){

		num1[str[i] - 'a']++;

	}

	solve();

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<iostream>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long LL;

const int MAXN = 1e5;



char s[MAXN + 5],ans[MAXN + 5];

LL a[MAXN + 5],b[MAXN + 5];

bool q = 0;

LL sum = 0,k = 0;



int main(){

	memset(s,0,sizeof(s));

	cin >> s+1;

	cin >> k;

	int len = strlen(s+1);

	for(int i = 1;i <= len;i++){

		a[i] = (LL)s[i];

	}

	for(int i = 1;i <= len;i++){

		if(k ==0)break;

		if(a[i] == 97)continue;

		else{

			if(a[i]+k >122){

				k =k - (122 - a[i]+1);

				a[i] = 97;	

			}

		}

	}

	if(k > 0){

		if(k > 26)k %=26;

		a[len] += k;

		if(a[len] > 122){

			a[len] = 97 + a[len] - 122 - 1;

		}

	}

	for(int i = 1;i <= len;i++){

		cout << (char)a[i];

	}

	cout << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.8586207928778045x):
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<cmath>

#include<algorithm>

using namespace std;

char str[100005];

int num[100005];

int main()

{

	int k,i,j,min,bei;

	scanf("%s",str);

	scanf("%d",&k);

	int len = strlen(str);

	for(i = 0;i < len; i++)

	{

		if(str[i] == 'a')

		{

			num[i] = 0;

			continue;

		}

		num[i] = 'z' - str[i] + 1;

	}

	for(i = 0;i < len; i++)

	{

		if(k == 0)

			break;

		if(i + 1 < len)

		{	

			if(k >= num[i] && str[i] != 'a')

			{

				str[i] = 'a';

				k -= num[i];

			}

		}

		else

		{

			k = k % 26;

			if(str[i] + k <= 'z')

			{

				str[i] = str[i] + k;

				}

			else

			{

				k = k - num[i];

				str[i] = 'a';

				str[i] = str[i] + k;

				}

			k = 0;

		}

	}

	puts(str);

	return 0;

}
// Slower C++ solution:
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<iostream>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long LL;

const int MAXN = 1e5;



char s[MAXN + 5],ans[MAXN + 5];

LL a[MAXN + 5],b[MAXN + 5];

bool q = 0;

LL sum = 0,k = 0;



int main(){

	memset(s,0,sizeof(s));

	cin >> s+1;

	cin >> k;

	int len = strlen(s+1);

	for(int i = 1;i <= len;i++){

		a[i] = (LL)s[i];

	}

	for(int i = 1;i <= len;i++){

		if(k ==0)break;

		if(a[i] == 97)continue;

		else{

			if(a[i]+k >122){

				k =k - (122 - a[i]+1);

				a[i] = 97;	

			}

		}

	}

	if(k > 0){

		if(k > 26)k %=26;

		a[len] += k;

		if(a[len] > 122){

			a[len] = 97 + a[len] - 122 - 1;

		}

	}

	for(int i = 1;i <= len;i++){

		cout << (char)a[i];

	}

	cout << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.1072929557529592x):
#include<cstdio>

#include<cmath>

#include<cstring>

#include<algorithm>

#include<string>

#include<cstdlib>

#include<iostream>

using namespace std;

const int MaxN = 1e5 + 5;

char a[MaxN];

int main()

{

	int m;

	long long k;

	cin >> a;

	scanf("%lld", &k);

	long long len = strlen(a);

	long long j = len - 1;

	for(int i = 0; i < len - 1; i++) {

		if(a[i] == 'a') m = 0;  //  不特判a的话 m = ’z' - ‘a' + 1 = 26 使得 k减少26 

		else m = 'z' - a[i] + 1;

		k = k - m;

		if(k >= 0) a[i] = 'a';

		else k = k + m;

	}  

	k = k % 26;  // 防止k太大

	if( k + a[j] > 'z') a[j] = a[j] - 26 + k;  // 超出asc码

	else a[j] = k + a[j];

	cout << a << endl;

}
// Slower C++ solution:
#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<iostream>

#include<cmath>

#include<algorithm>

using namespace std;

typedef long long LL;

const int MAXN = 1e5;



char s[MAXN + 5],ans[MAXN + 5];

LL a[MAXN + 5],b[MAXN + 5];

bool q = 0;

LL sum = 0,k = 0;



int main(){

	memset(s,0,sizeof(s));

	cin >> s+1;

	cin >> k;

	int len = strlen(s+1);

	for(int i = 1;i <= len;i++){

		a[i] = (LL)s[i];

	}

	for(int i = 1;i <= len;i++){

		if(k ==0)break;

		if(a[i] == 97)continue;

		else{

			if(a[i]+k >122){

				k =k - (122 - a[i]+1);

				a[i] = 97;	

			}

		}

	}

	if(k > 0){

		if(k > 26)k %=26;

		a[len] += k;

		if(a[len] > 122){

			a[len] = 97 + a[len] - 122 - 1;

		}

	}

	for(int i = 1;i <= len;i++){

		cout << (char)a[i];

	}

	cout << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.119549735583412x):
#include<cstdio>

#include<iostream>

#include<cstring>

#include<algorithm>

#include<cmath>

#include<queue>

#include<set>

#include<map>

using namespace std;

typedef long long ll;

const int inf=1<<29;

const ll Maxn=1e6;

const double pi=3.1415926536;



string t=" abcdefghijklmnopqrstuvwxyz";

char s[Maxn];



int main(){

	ll k;

	int m;

	scanf("%s",s);

	scanf("%lld",&k);

	int len=strlen(s);

	int j=len-1;

	for(int i=0;i<len-1;i++){

		if(s[i]=='a') m=0;

		else m='z'-s[i]+1;

		k-=m;

		if(k>=0) s[i]='a';

		else k+=m;

	}

	k%=26;

	if(k>'z'-s[j]) s[j]=t[k-('z'-s[j])];

	else s[j]=t[s[j]-'a'+k+1];

	printf("%s\n",s);

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

using namespace std;

#define Khela ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long int

#define llu long long unsigned int

#define pf printf

#define sf scanf

#define f first

#define s second

#define pb push_back

#define mk make_pair

#define pii pair<int ,int>

#define PII pair<ll ,ll>

 

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};

int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int dx4[] = {0, 0, 1, -1};

int dy4[] = {1, -1, 0, 0};

 

typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

int Set(int N,int pos){return N=N | (1<<pos);}

int reset(int N,int pos){return N= N & ~(1<<pos);}

bool check(int N,int pos){return (bool)(N & (1<<pos));}

const int max=1e9+100;

const ll  MAX=1e18+500;

const int sz=2e5+100;

int mark[sz];

int main()

{

    Khela

    int a,b,c,i,j,k,q,p,x,y,ct,ct1,m,l,r,x1,y1,mn,h,sum1,in,z,mid,n,mx;

    char ch;

    double d;

    string str1,str2,str;

    bool bl,bl1;

    int t,cs=1;

    while(cin>>n)

    {

        memset(mark,0,sizeof mark);

        int ara[n+2];

        for(i=1;i<=n;i++) cin>>ara[i];



        int ct=0;

        for(i=n;i>=1;i--){

           int tot=0;

           for(j=i+i;j<=n;j+=i) tot+=mark[j];

           if(tot % 2 != ara[i]){

               ++ct;

               ++mark[i];

           }

        }

        

        cout<<ct<<endl;

        for(i=1;i<=n;i++){

            if(mark[i]>0){

                cout<<i<<" ";

            }

        }

       if(ct>0) cout<<endl;

      

        

    }











}

// Faster C++ solution for the same problem (measured speedup: 1.8294247833013257x):
#include<bits/stdc++.h>

#define LLI long long int

#define ULTRA 2134567890

#define de(x) if(x!=0 && MODE==x)

#define MODE 1

using namespace std;



int arr[200007];

bool b[200007];



int main()

{

    int i,j;

    int N;



    scanf("%d", &N);



    int cnt = 0;

    for( i=1; i<=N; i++)

    {

        scanf("%d", &arr[i]);

    }



    vector<int> keep;

    for( i=N; i>=1; i--)

    {

        if( b[i] != arr[i])

        {

            for( j=1; j*j<=i; j++)

            {

                if(i%j==0)

                {

                    b[j] ^= 1;

                    if( j*j!=i)

                        b[i/j] ^= 1;

                }

            }

            keep.push_back(i);

        }

    }



    printf("%d\n", keep.size());

    for( auto it:keep)

    {

        printf("%d ", it);

    }

    printf("\n");



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

using namespace std;

#define Khela ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long int

#define llu long long unsigned int

#define pf printf

#define sf scanf

#define f first

#define s second

#define pb push_back

#define mk make_pair

#define pii pair<int ,int>

#define PII pair<ll ,ll>

 

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};

int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int dx4[] = {0, 0, 1, -1};

int dy4[] = {1, -1, 0, 0};

 

typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

int Set(int N,int pos){return N=N | (1<<pos);}

int reset(int N,int pos){return N= N & ~(1<<pos);}

bool check(int N,int pos){return (bool)(N & (1<<pos));}

const int max=1e9+100;

const ll  MAX=1e18+500;

const int sz=2e5+100;

int mark[sz];

int main()

{

    Khela

    int a,b,c,i,j,k,q,p,x,y,ct,ct1,m,l,r,x1,y1,mn,h,sum1,in,z,mid,n,mx;

    char ch;

    double d;

    string str1,str2,str;

    bool bl,bl1;

    int t,cs=1;

    while(cin>>n)

    {

        memset(mark,0,sizeof mark);

        int ara[n+2];

        for(i=1;i<=n;i++) cin>>ara[i];



        int ct=0;

        for(i=n;i>=1;i--){

           int tot=0;

           for(j=i+i;j<=n;j+=i) tot+=mark[j];

           if(tot % 2 != ara[i]){

               ++ct;

               ++mark[i];

           }

        }

        

        cout<<ct<<endl;

        for(i=1;i<=n;i++){

            if(mark[i]>0){

                cout<<i<<" ";

            }

        }

       if(ct>0) cout<<endl;

      

        

    }











}

// Faster C++ solution for the same problem (measured speedup: 1.806465988957769x):
#include <bits/stdc++.h>

using namespace std;



int main()

{

	int n,ans=0;

	cin>>n;

	int a[n+1]={},b[n+1]={};

	vector<int> vec;

	for(int i = 1 ; i <= n ; i++)

	{

		cin>>a[i];

	}

	for(int i = n ; i >= 1 ; i--)

	{

		int sum = 0;

		

		for(int j = i ; j <= n ; j += i)

		{

			sum += b[j];

			sum %= 2;

		}

		if( sum != a[i] )

		{

			b[i]++;

			b[i] %= 2;

			ans++;

			vec.push_back(i);

		}

		

	}

	cout<<ans<<"\n";

	for(unsigned int i = 0; i < vec.size() ; i++)

		cout << vec[i] << " ";

	



	return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

using namespace std;

#define Khela ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long int

#define llu long long unsigned int

#define pf printf

#define sf scanf

#define f first

#define s second

#define pb push_back

#define mk make_pair

#define pii pair<int ,int>

#define PII pair<ll ,ll>

 

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};

int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int dx4[] = {0, 0, 1, -1};

int dy4[] = {1, -1, 0, 0};

 

typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

int Set(int N,int pos){return N=N | (1<<pos);}

int reset(int N,int pos){return N= N & ~(1<<pos);}

bool check(int N,int pos){return (bool)(N & (1<<pos));}

const int max=1e9+100;

const ll  MAX=1e18+500;

const int sz=2e5+100;

int mark[sz];

int main()

{

    Khela

    int a,b,c,i,j,k,q,p,x,y,ct,ct1,m,l,r,x1,y1,mn,h,sum1,in,z,mid,n,mx;

    char ch;

    double d;

    string str1,str2,str;

    bool bl,bl1;

    int t,cs=1;

    while(cin>>n)

    {

        memset(mark,0,sizeof mark);

        int ara[n+2];

        for(i=1;i<=n;i++) cin>>ara[i];



        int ct=0;

        for(i=n;i>=1;i--){

           int tot=0;

           for(j=i+i;j<=n;j+=i) tot+=mark[j];

           if(tot % 2 != ara[i]){

               ++ct;

               ++mark[i];

           }

        }

        

        cout<<ct<<endl;

        for(i=1;i<=n;i++){

            if(mark[i]>0){

                cout<<i<<" ";

            }

        }

       if(ct>0) cout<<endl;

      

        

    }











}

// Faster C++ solution for the same problem (measured speedup: 1.802435185492772x):
#include <bits/stdc++.h>

using namespace std;



#define rep(i,n) for(long long i=0; i<n; i++)



int main() {

  int n;

  cin >> n;

  vector<int> a(n), b(n, 0);

  

  set<int> st;

  rep(i, n) cin >> a[i];



  for (int i = n; i > 0; --i) {

    int cnt = 0;

    for (int j = i + i; j <= n; j += i) {

      cnt += b[j - 1];

    }

    if (cnt % 2 != a[i-1]) {

      b[i-1] = 1;

      st.insert(i);

    }

  }



  cout << st.size() << endl;

    if (st.size()) {

      for (auto&& itr : st) {

      cout << itr << " ";

    }

  }

  



}
// Slower C++ solution:
#include<bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;

using namespace std;

#define Khela ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

#define ll long long int

#define llu long long unsigned int

#define pf printf

#define sf scanf

#define f first

#define s second

#define pb push_back

#define mk make_pair

#define pii pair<int ,int>

#define PII pair<ll ,ll>

 

int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};

int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};

int dx4[] = {0, 0, 1, -1};

int dy4[] = {1, -1, 0, 0};

 

typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

int Set(int N,int pos){return N=N | (1<<pos);}

int reset(int N,int pos){return N= N & ~(1<<pos);}

bool check(int N,int pos){return (bool)(N & (1<<pos));}

const int max=1e9+100;

const ll  MAX=1e18+500;

const int sz=2e5+100;

int mark[sz];

int main()

{

    Khela

    int a,b,c,i,j,k,q,p,x,y,ct,ct1,m,l,r,x1,y1,mn,h,sum1,in,z,mid,n,mx;

    char ch;

    double d;

    string str1,str2,str;

    bool bl,bl1;

    int t,cs=1;

    while(cin>>n)

    {

        memset(mark,0,sizeof mark);

        int ara[n+2];

        for(i=1;i<=n;i++) cin>>ara[i];



        int ct=0;

        for(i=n;i>=1;i--){

           int tot=0;

           for(j=i+i;j<=n;j+=i) tot+=mark[j];

           if(tot % 2 != ara[i]){

               ++ct;

               ++mark[i];

           }

        }

        

        cout<<ct<<endl;

        for(i=1;i<=n;i++){

            if(mark[i]>0){

                cout<<i<<" ";

            }

        }

       if(ct>0) cout<<endl;

      

        

    }











}

// Faster C++ solution for the same problem (measured speedup: 1.8032009886986788x):
#include<bits/stdc++.h>

#define int long long

using namespace std;



int32_t main(){

	int n;

	cin >> n;

	vector<int> vec(n+1);

	for(int i = 1; i <= n; i++){

		cin >> vec[i];

	}

	vector<int> ans;

	vector<int> build(n+1);

	for(int i = n; i >= 1; i--){

		int sum = build[i];

		for(int j = i+i; j <= n; j+=i){

			sum += build[j]; 

		}

		if(sum % 2 != vec[i]){

			build[i] += 1;

			ans.push_back(i);

		}

	}

	bool exist = true;

	for(int i = 1; i <= n && exist == true; i++){

		int sum = 0;

		for(int j = i; j <= n; j+=i){

			sum += build[j];

		}

		exist &= (sum % 2 == vec[i]);

	}

	if(exist == false){

		cout << "-1" << endl;

	}else{

		cout << ans.size() << endl;

		for(int a : ans){

			cout << a << " ";

		}

	}

}