显示代码纯文本
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <iomanip>
using namespace std;
long long n,a[1010],t=0;
bool flag=0,f[1010];
void dfs(int k,long long ans)
{
if (!ans&&t) flag=1;
if (flag||k>n) return;
dfs(k+1,ans);
if (flag) return;
f[k]=1;
t++;
if (ans) dfs(k+1,ans^a[k]);
else dfs(k+1,a[k]);
if (flag) return;
t--;
f[k]=0;
}
int main()
{
freopen("asm_contribute.in","r",stdin);
freopen("asm_contribute.out","w",stdout);
ios::sync_with_stdio(false);
cin>>n;
for (int i=1;i<=n;i++)
cin>>a[i];
dfs(1,0);
cout<<t<<endl;
for (int i=1;i<=n;i++)
if (f[i])
cout<<i<<' ';
//fclose(stdin); fclose(stdout);
return 0;
}