显示代码纯文本
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
#define MAXN (1005)
long long a[MAXN];
long long ans[MAXN];
int main()
{
freopen("asm_contribute.in", "r", stdin);
freopen("asm_contribute.out", "w", stdout);
int n,i,j;
int len;
cin >> n;
for(i = 1; i <= n; i++)
cin >> a[i];
for(len = 1; len <= n; len++)
{
ans[len] = ans[len-1]^a[len];
for(i = len+1; i <= n; i++)
{
if((a[i]^ans[len]) == 0)
{
cout << len+1 << endl;
for(j = 1; j <= len; j++)
cout << j << ' ';
cout << i << endl;
return 0;
}
}
}
return 0;
}